[Tutor] retrieve data from an online database without knowing the url

Evert Rol evert.rol at gmail.com
Thu Nov 15 11:14:41 CET 2007


> I was wondering whether it was possible to write a program which  
> could directly write some word in a box and click 'search' on a  
> typical online database without using the url. (e.g. is there a way  
> to write a program which would write some keyword, say 'tomato' on  
> google and click 'google search' automatically and copy the page  
> without having to know the url 'http://www.google.com/search? 
> hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=tomato&spell=1')
> Thank you very much for any help you could provide,

I would use urllib & urllib2 (google around for some example code),  
but then you'll still have to know
- the names of the input search box and search button
- whether it's a get or post form
Some of this info can be gotten by first downloading the form and  
examine it for tags (such as 'action'), but possibly not all.

Other than that, I wouldn't really know.



More information about the Tutor mailing list