Obtain Web Page : Web Client : Network PYTHON examples


PYTHON examples » Network » Web Client »

 

Obtain Web Page



import sys, urllib2

req = urllib2.Request(sys.argv[1])
fd = urllib2.urlopen(req)
while 1:
    data = fd.read(1024)
    if not len(data):
        break
    sys.stdout.write(data)

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Network
» Web Client


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0