google search with python requests library -


(i've tried looking of other answers seem using urllib2)

i've started trying use requests, i'm still not clear on how send or request additional page. example, i'll have

import requests  r = requests.get('http://google.com') 

but have no idea how now, example, google search using search bar presented. i've read quickstart guide i'm not familiar html post , like, hasn't been helpful.

is there clean , elegant way asking?

request overview

the google search request standard http command. includes collection of parameters relevant queries. these parameters included in request url name=value pairs separated ampersand (&) characters. parameters include data search query , unique cse id (cx) identifies cse making http request. websearch or image search service returns xml results in response http requests.

first, must cse id (cx parameter) @ control panel of custom search engine

then, see official google developers site custom search.

there many examples this:

http://www.google.com/search?   start=0   &num=10   &q=red+sox   &cr=countryca   &lr=lang_fr   &client=google-csbe   &output=xml_no_dtd   &cx=00255077836266642015:u-scht7a-8i 

and there explained list of parameters can use.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -