Created
April 29, 2024 20:38
-
-
Save ElpixZero/37143e86803b9254c5fba16846a786a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib import request | |
url = 'http://google.com' | |
req = request.Request(url) | |
print(req.__dict__) | |
# reqDict это собственно это req.__dict__ | |
reqDict = {'_full_url': 'http://google.com', 'fragment': None, 'type': 'http', 'host': 'google.com', 'selector': '', 'headers': {}, 'unredirected_hdrs': {}, '_data': None, '_tunnel_host': None, 'origin_req_host': 'google.com', 'unverifiable': False} | |
res = request.urlopen(reqDict) | |
print(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment