URLFetch API Response 400

137 views
Skip to first unread message

Prateek Malhotra

unread,
Jun 22, 2008, 6:19:46 PM6/22/08
to Google App Engine
I am trying to scrape info from this URL:
http://news.google.com/news?hl=en&ned=us&ie=UTF-8&q="Company
Name"&btnG=Search&as_drrb=b&as_minm=05&as_mind=2&as_maxm=06&as_maxd=1

When i use it in the urlfetch.fetch() function, i get a "Your client
has issued a malformed or illegal request. (400 Bad Request)" response
from Google. I can go to google.com just fine, but when going to
news.google.com which the search terms predefined, i get that error,
does anybody have any ideas why?

Thanks

-Prateek

Brett Morgan

unread,
Jun 22, 2008, 6:27:57 PM6/22/08
to google-a...@googlegroups.com
Want to show us the code?

--

Brett Morgan http://brett.morgan.googlepages.com/

Prateek Malhotra

unread,
Jun 22, 2008, 6:34:01 PM6/22/08
to Google App Engine
Hey,

I figured it out, turns out if I don't replace the spaces in the
search term with '+' it craps out on me.

Thanks anyway guys!

-Prateek
Reply all
Reply to author
Forward
0 new messages