Difference between revisions of "Urllib"

From wikieduonline
Jump to navigation Jump to search
Line 6: Line 6:
  
 
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/')

Revision as of 14:06, 10 November 2022

Advertising: