Re: HTTP request error with urlopen

2008-07-03 Thread Jonas Galvez
Try: import re import urllib2 url = 'http://www.google.com/search?num=20&hl=en&q=ipod&btnG=Search' user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers = {'User-Agent' : user_agent} req = urllib2.Request(url, None, headers) file_source=open("google_source.txt", 'w') file_source.wr

HTTP request error with urlopen

2008-07-03 Thread spandana g
Hello , I have written a code to get the page source of the google search page .. this is working for other urls. I have this problem with import re from urllib2 import urlopen string='http://www.google.com/search?num=20&hl=en&q=ipod&btnG=Search' file_source=file("google_source.txt",'w'

HTTP request error with urlopen

2008-07-02 Thread spandana g
Hello , I have written a code to get the page source of the google search page .. this is working for other urls. I have this problem with import re from urllib2 import urlopen string='http://www.google.com/search?num=20&hl=en&q=ipod&btnG=Search' file_source=file("google_source.txt",'w'