tags:

views:

88

answers:

1

I am new to programming, i had some problem with the code.. Here i have posted the code below. Actually after running the program its shows some error...

ERROR: It shows some traceback error

import urllib
proxies = {'http' : 'http://proxy:80'}
urlopener = urllib.FancyURLopener(proxies)
htmlpage = urlopener.open('http://www.google.com')
data = htmlpage.readlines()
print data
A: 

You need indent your python and replace readlines() with read()

import urllib 
proxies = {'http' : 'http://proxy:80'} 
urlopener = urllib.FancyURLopener(proxies) 
htmlpage = urlopener.open('http://www.google.com') 
data = htmlpage.read() 
print data
Gunslinger_