| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Python315/Lib/urllib/__pycache__/ |
Upload File : |
R
>lqjI5 c � � Q s ] PHs] PHs] PHs] PHs] PHs] PHs] PH s] PH$s ] PH(s
] PH,s] PH0s] PH4s
] PH8s] PH<s] QH@GsGsGs ] QHPGsGsGsGsGsGsGsGsGsGsGsG s G!s!G"s"G#s#G$s$ ] QH�G&s&G's' ] PH�s(P s), QMQMQMQMQMQ MQ
MQMQMQ
MQMQMQMQMQMQMQMQMQMQMQMQMQMQMQMQMQMQMQ MQ!MQ"Ms+Q#\
OX Q$* * s-Pr.P\O^ 1Q%P-Q& kks0Q' s1, s2QgQ( ks3Q) s4\
Oj Q*\
Ol 2 s7Q+ s8 Q, Q2 s9 Q- Q2 s:Q. s; Q/ Q2 s< Q0 Q\<2 s= Q1 Q\<2 s> Q2 Q\<2 s?Q3 s@ Q4 Q
\<2 sA Q5 Q2 sB Q6 Q\B2 sC Q7 Q
\C2 sD Q8 Q2 sE Q9 Q\E\<2 sF Q: Q\E\<2 sG\ O� sI Q; Q2 sJ Q< Q\<\J2 sK Q= Q\<\J2 sL Q> Q?\<2 sM Q@ Q\M2 sN\O \O� QA2 % c QB QC\M2 sQ\+O� QC2 QD Q \<2 sS QE Q\<2 sTQF sUQG sV QH Q\<2 sWQI sX QJ Q\<2 sY QK Q\Y2 sZ QL Q\<2 s[QMP
QNP
-QO ks\QPP
-QQ ks]Pr^QR s_Pr`QS saPrbQT scPrdQU se QV QW2 sfQX sgQhQY kshQZ siQ[ sj\
O� Q\6X c ] Q]CH�GmsmGnsn Q^ soQ_ spQ` sqQa srP! \ O� Qb6X c Qc stQd srQe suQf sqP! \gsr\hsqP! \* c P
s) CK�h 9 h)ia�
An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra methods described below.
The OpenerDirector manages a collection of Handler objects that do
all the actual work. Each Handler implements a particular protocol or
option. The OpenerDirector is a composite object that invokes the
Handlers needed to open the requested URL. For example, the
HTTPHandler performs HTTP GET and POST requests and deals with
non-error returns. The HTTPRedirectHandler automatically deals with
HTTP 301, 302, 303, 307, and 308 redirect errors, and the
HTTPDigestAuthHandler deals with digest authentication.
urlopen(url, data=None) -- Basic usage is the same as original
urllib. pass the url and optionally data to post to an HTTP URL, and
get a file-like object back. One difference is that you can also pass
a Request instance instead of URL. Raises a URLError (subclass of
OSError); for HTTP errors, raises an HTTPError, which can also be
treated as a valid response.
build_opener -- Function that creates a new OpenerDirector instance.
Will install the default handlers. Accepts one or more Handlers as
arguments, either instances or Handler classes that it will
instantiate. If one of the argument is a subclass of the default
handler, the argument will be installed instead of the default.
install_opener -- Installs a new opener as the default opener.
objects of interest:
OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages
the Handler classes, while dealing with requests and responses.
Request -- An object that encapsulates the state of a request. The
state can be as simple as the URL. It can also include extra HTTP
headers, e.g. a User-Agent.
BaseHandler --
internals:
BaseHandler and parent
_call_chain conventions
Example usage:
import urllib.request
# set up authentication info
authinfo = urllib.request.HTTPBasicAuthHandler()
authinfo.add_password(realm='PDQ Application',
uri='https://mahler:8092/site-updates.py',
user='klem',
passwd='geheim$parole')
proxy_support = urllib.request.ProxyHandler({"http" : "http://ahad-haam:3128"})
# build a new opener that adds authentication and caching FTP handlers
opener = urllib.request.build_opener(proxy_support, authinfo,
urllib.request.CacheFTPHandler)
# install it
urllib.request.install_opener(opener)
f = urllib.request.urlopen('https://www.python.org/')
)�URLError� HTTPError�ContentTooShortError)�urlparse�urlsplit�urljoin�unwrap�quote�unquote�
_splittype�
_splithost�
_splitport�
_splituser�_splitpasswd�
_splitattr�_splitvalue� _splittag�unquote_to_bytes�
urlunparse)�
addinfourl�addclosehook�Request�OpenerDirector�BaseHandler�HTTPDefaultErrorHandler�HTTPRedirectHandler�HTTPCookieProcessor�ProxyHandler�HTTPPasswordMgr�HTTPPasswordMgrWithDefaultRealm�HTTPPasswordMgrWithPriorAuth�AbstractBasicAuthHandler�HTTPBasicAuthHandler�ProxyBasicAuthHandler�AbstractDigestAuthHandler�HTTPDigestAuthHandler�ProxyDigestAuthHandler�HTTPHandler�FileHandler�
FTPHandler�CacheFTPHandler�DataHandler�UnknownHandler�HTTPErrorProcessor�urlopen�install_opener�build_opener�pathname2url�url2pathname�
getproxies�urlretrieve�
urlcleanupz%d.%d:N� N�contextc � � U% c [ UQ5 o[ U2 oL[ e [ 2 9roL[ oUO VU2 ! )a� Open the URL url, which can be either a string or a Request object.
*data* must be an object specifying additional data to be sent to
the server, or None if no such data is needed. See Request for
details.
urllib.request module uses HTTP/1.1 and includes a "Connection:close"
header in its HTTP requests.
The optional *timeout* parameter specifies a timeout in seconds for
blocking operations like the connection attempt (if not specified, the
global default timeout setting will be used). This only works for HTTP,
HTTPS and FTP connections.
If *context* is specified, it must be a ssl.SSLContext instance describing
the various SSL options. See HTTPSConnection for more details.
This function always returns an object which can work as a
context manager and has the properties url, headers, and status.
See urllib.response.addinfourl for more detail on these properties.
For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
object slightly modified. In addition to the three new methods above, the
msg attribute contains the same information as the reason attribute ---
the reason phrase returned by the server --- instead of the response
headers as it is specified in the documentation for HTTPResponse.
For FTP, file, and data URLs, this function returns a
urllib.response.addinfourl object.
Note that None may be returned if no handler handles the request (though
the default installed global OpenerDirector uses UnknownHandler to ensure
this never happens).
In addition, if proxy settings are detected (for example, when a *_proxy
environment variable like http_proxy is set), ProxyHandler is default
installed and makes sure the requests are handled through the proxy.
�r6 )�HTTPSHandlerr/ �_opener�open)�url�data�timeoutr6 �
https_handler�openers &&&$ �#C:\Python315\\Lib\urllib\request.pyr- r- � sC � �V �$�W�5�
��m�,�� ��'�>�)��&����;�;�s�'�*�*� c � � U r P! �N)r: )r@ s &rA r. r. � s � ��GrB c � � [ U 2 v qE[ O [ V2 2 9^tt^ 2 oUO 2 oUQ6X c4 U% f, [
O O U2 U1ttPPP2 ! U% c [ UQ2 oL8[ O P
Q5 oUO o[ O U2 S9^tt^ 2 V1o Qo
Po] o] o
QU7 c [ UQ* 2 oU% c
U V�U2 UO U
2 9o% cB U[! U2 *
oUO# U2 U
]*
o
U% f JO U V�U2 JZ PPP2 PPP2 W] 6� c WU6 c [% QV�1* W 2 gW ! ) % f h K<9 h ) % f h KG9 h)a+
Retrieve a URL into a temporary location on disk.
Requires a URL argument. If a filename is passed, it is used as
the temporary file location. The reporthook argument should be
a callable that accepts a block number, a read size, and the
total file size of the URL target. The data argument should be
valid URL encoded data.
If a filename is passed and the URL points to a local resource,
the result is a copy from local file to new file.
Returns a tuple containing the path to the newly created
data file as well as the resulting HTTPMessage object.
�file�wb)�delete�content-lengthzContent-Lengthz1retrieval incomplete: got only %i out of %i bytesi )r
�
contextlib�closingr- �info�os�path�normpathr; �tempfile�NamedTemporaryFile�name�_url_tempfiles�append�int�read�len�writer )r<