Difference between revisions of "Urllib"

From wikieduonline
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{lc}}
 +
https://docs.python.org/3/library/urllib.request.html
 +
 
  urllib.request
 
  urllib.request
  
  
 
Adding [[HTTP headers]]:
 
Adding [[HTTP headers]]:
  import urllib.request
+
  [[import]] urllib.request
 
  req = urllib.request.Request('http://www.example.com/')
 
  req = urllib.request.Request('http://www.example.com/')
 
  req.add_header('Referer', 'http://www.python.org/')
 
  req.add_header('Referer', 'http://www.python.org/')
Line 10: Line 13:
 
  r = urllib.request.urlopen(req)
 
  r = urllib.request.urlopen(req)
  
 +
== See also ==
 +
* {{Python}}
  
* {{Python}}
+
[[Category:Python]]

Latest revision as of 14:07, 10 November 2022

Advertising: