1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
U
\±d)ã@s2dZGdd„dƒZGdd„dƒZGdd„dƒZdS)zThe Proxy implementation.c@seZdZdZedd„ƒZdS)ÚProxyTypeFactoryzFactory for proxy types.cCs
||dœS)N©Zff_valueÚstring©rrrúVd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/proxy.pyÚmakeszProxyTypeFactory.makeN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú staticmethodrrrrrrsrc@speZdZdZe dd¡Ze dd¡Ze dd¡Ze dd    ¡Z    e d
d ¡Z
e d d ¡Z e dd¡Z e dd„ƒZdS)Ú    ProxyTypez¦Set of possible types of proxy.
 
    Each proxy type has 2 properties:    'ff_value' is value of Firefox
    profile preference,    'string' is id of proxy type.
    éÚDIRECTéÚMANUALéÚPACéZ    RESERVED1éÚ
AUTODETECTéÚSYSTEMéÚ UNSPECIFIEDcCsvt|tƒrd|kr|d}t|ƒ ¡}t|ƒD]4}t||ƒ}t|tƒr.d|kr.|d|kr.|Sq.td|›ƒ‚dS)NrzNo proxy type is found for )Ú
isinstanceÚdictÚstrÚupperÚdirÚgetattrÚ    Exception)ÚclsÚvalueÚattrÚ
attr_valuerrrÚload,s  
 
zProxyType.loadN)rrr    r
rrrrrZ
RESERVED_1rrrÚ classmethodr%rrrrr s       r c@s¸eZdZdZejZdZdZdZ    dZ
dZ dZ dZ dZdZdZd-dd„Zedd„ƒZejdd    œd
d„ƒZed d „ƒZejdd    œd d „ƒZedd„ƒZejdd    œdd„ƒZedd„ƒZejdd    œdd„ƒZedd„ƒZejdd    œdd„ƒZedd„ƒZejdd    œdd„ƒZedd„ƒZejdd    œdd„ƒZedd„ƒZejdd    œdd„ƒZed d!„ƒZejdd    œd"d!„ƒZed#d$„ƒZejdd    œd%d$„ƒZed&d'„ƒZejdd    œd(d'„ƒZd)d*„Zd+d,„Z dS).ÚProxyzMProxy contains information about proxy type and necessary proxy
    settings.FÚNcCs6|r2d|kr&|dr&t |d¡|_d|kr@|dr@|d|_d|krZ|drZ|d|_d|krt|drt|d|_d|krŽ|drŽ|d|_d|kr¨|dr¨|d|_d|krÂ|drÂ|d|_d|krÜ|drÜ|d|_    d    |krö|d    rö|d    |_
d
|kr|d
r|d
|_ d |kr2|d r2|d |_ d S) zuCreates a new Proxy.
 
        :Args:
         - raw: raw proxy data. If None, default class values are used.
        Ú    proxyTypeÚftpProxyÚ    httpProxyÚnoProxyÚproxyAutoconfigUrlÚsslProxyÚ
autodetectÚ
socksProxyÚ socksUsernameÚ socksPasswordÚ socksVersionN) r r%Ú
proxy_typeÚ    ftp_proxyÚ
http_proxyÚno_proxyÚproxy_autoconfig_urlr.Ú auto_detectÚ socks_proxyÚsocks_usernameÚsocks_passwordÚ socks_version)ÚselfÚrawrrrÚ__init__Hs.
 
 
 
 
 
 
 
 
zProxy.__init__cCs|jS)z"Returns proxy type as `ProxyType`.)r)©r>rrrr4fszProxy.proxy_type)ÚreturncCs| |¡||_dS)zKSets proxy type.
 
        :Args:
         - value: The proxy type.
        N)Ú _verify_proxy_type_compatibilityr)©r>r"rrrr4ks
cCs|jS)zReturns autodetect setting.)r/rArrrr9uszProxy.auto_detectcCs<t|tƒr0|j|k    r8| tj¡tj|_||_ntdƒ‚dS)zYSets autodetect setting.
 
        :Args:
         - value: The autodetect value.
        z,Autodetect proxy value needs to be a booleanN)rÚboolr/rCr rr)Ú
ValueErrorrDrrrr9zs 
 
 cCs|jS)zReturns ftp proxy setting.)r*rArrrr5‰szProxy.ftp_proxycCs| tj¡tj|_||_dS)zWSets ftp proxy setting.
 
        :Args:
         - value: The ftp proxy value.
        N)rCr rr)r*rDrrrr5Žs cCs|jS)zReturns http proxy setting.)r+rArrrr6™szProxy.http_proxycCs| tj¡tj|_||_dS)zYSets http proxy setting.
 
        :Args:
         - value: The http proxy value.
        N)rCr rr)r+rDrrrr6žs cCs|jS)zReturns noproxy setting.)r,rArrrr7©szProxy.no_proxycCs| tj¡tj|_||_dS)zSSets noproxy setting.
 
        :Args:
         - value: The noproxy value.
        N)rCr rr)r,rDrrrr7®s cCs|jS)z%Returns proxy autoconfig url setting.)r-rArrrr8¹szProxy.proxy_autoconfig_urlcCs| tj¡tj|_||_dS)zmSets proxy autoconfig url setting.
 
        :Args:
         - value: The proxy autoconfig url value.
        N)rCr rr)r-rDrrrr8¾s cCs|jS)zReturns https proxy setting.)r.rArrrÚ    ssl_proxyÉszProxy.ssl_proxycCs| tj¡tj|_||_dS)z[Sets https proxy setting.
 
        :Args:
         - value: The https proxy value.
        N)rCr rr)r.rDrrrrGÎs cCs|jS)zReturns socks proxy setting.)r0rArrrr:ÙszProxy.socks_proxycCs| tj¡tj|_||_dS)z[Sets socks proxy setting.
 
        :Args:
         - value: The socks proxy value.
        N)rCr rr)r0rDrrrr:Þs cCs|jS)z%Returns socks proxy username setting.)r1rArrrr;észProxy.socks_usernamecCs| tj¡tj|_||_dS)zmSets socks proxy username setting.
 
        :Args:
         - value: The socks proxy username value.
        N)rCr rr)r1rDrrrr;îs cCs|jS)z%Returns socks proxy password setting.)r2rArrrr<ùszProxy.socks_passwordcCs| tj¡tj|_||_dS)zmSets socks proxy password setting.
 
        :Args:
         - value: The socks proxy password value.
        N)rCr rr)r2rDrrrr<þs cCs|jS)z$Returns socks proxy version setting.)r3rArrrr=    szProxy.socks_versioncCs| tj¡tj|_||_dS)zkSets socks proxy version setting.
 
        :Args:
         - value: The socks proxy version value.
        N)rCr rr)r3rDrrrr=s cCs,|jtj|fkr(td|›d|j›dƒ‚dS)NzSpecified proxy type (z') not compatible with current setting (ú))r)r rr )r>Zcompatible_proxyrrrrCsÿz&Proxy._verify_proxy_type_compatibilitycCsºd|jdi}|jr|j|d<|jr.|j|d<|jr>|j|d<|jrN|j|d<|jr^|j|d<|jrn|j|d<|jr~|j|d    <|jrŽ|j|d
<|j    rž|j    |d <|j
r®|j
|d <||d <dS)z Adds proxy information as capability in specified capabilities.
 
        :Args:
         - capabilities: The capabilities to which proxy will be added.
        r)rr/r*r+r-r.r,r0r1r2r3ÚproxyN) r)r/r*r+r-r.r,r0r1r2r3)r>Z capabilitiesZ
proxy_capsrrrÚadd_to_capabilitiess,
 
 
 
 
 
 
 
 
 
zProxy.add_to_capabilities)N)!rrr    r
r rr)r/r*r+r,r-r.r0r1r2r3r@Úpropertyr4Úsetterr9r5r6r7r8rGr:r;r<r=rCrJrrrrr'8sv
 
    
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
r'N)r
rr r'rrrrÚ<module>s