Python Forum
Outputing the results of search machine - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Outputing the results of search machine (/thread-792.html)



Outputing the results of search machine - Emmanouil - Nov-06-2016

Hello,

is it possible to make a programme that takes as arguments, a key word i.e q=help and the start and finish pages of the results of a search machine i.e page=0 to page=3(4 result pages) and output these result pages to 4 different html files?


RE: Outputing the results of search machine - Larz60+ - Nov-06-2016

Sounds like a scraper. See this tutorial Web scraping with Scrapy


RE: Outputing the results of search machine - nilamo - Nov-07-2016

Yes, that is possible.

For command line programs, check out sys.argv.
For web-based programs, you'll need to find out how your framework handles "url parameters". Most of them just use keyword arguments passed to the function assigned to the url path.


RE: Outputing the results of search machine - metulburr - Nov-07-2016

(Nov-07-2016, 04:42 PM)nilamo Wrote: For command line programs, check out sys.argv.
the argparse module is better than using sys.argv
https://docs.python.org/3/library/argparse.html


RE: Outputing the results of search machine - nilamo - Nov-07-2016

That's neat. I didn't know that was added.