Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #introduction to urllib2
- import urllib2
- import httplib
- #set httplib debuglevel
- httplib.HTTPConnection.debuglevel=1
- url= "http://cmyip.com/"
- #Request
- request=urllib2.Request(url)
- #build opener
- opener=urllib2.build_opener()
- data=opener.open(request).read()
- print repr(data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement