Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. urllib2.urlopen('http://google.com')
  2.  
  3. import urllib, urllib2, httplib
  4.  
  5. url = 'http://www.mozillazine.org/atom.xml'
  6. httplib.HTTPConnection.debuglevel = 1
  7.  
  8. print "urllib"
  9.  
  10. data = urllib.urlopen(url);
  11.  
  12. print "urllib2"
  13.  
  14. request = urllib2.Request(url)
  15. opener = urllib2.build_opener()
  16. feeddata = opener.open(request).read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement