Difference between revisions of "Urllib"

From wikieduonline
Jump to navigation Jump to search
(Created page with " urllib.request * {{Python}}")
 
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
{{lc}}
 +
https://docs.python.org/3/library/urllib.request.html
 +
 
  urllib.request
 
  urllib.request
  
  
 +
Adding [[HTTP headers]]:
 +
[[import]] urllib.request
 +
req = urllib.request.Request('http://www.example.com/')
 +
req.add_header('Referer', 'http://www.python.org/')
 +
# Customize the default User-Agent header value:
 +
req.add_header('User-Agent', 'urllib-example/0.1 (Contact: . . .)')
 +
r = urllib.request.urlopen(req)
  
 +
== Related ==
 +
* [[Dependabot]]
  
 +
== See also ==
 
* {{Python}}
 
* {{Python}}
 +
 +
[[Category:Python]]

Latest revision as of 15:21, 1 July 2024

Advertising: