tasos-py/Search-Engines-Scraper

list proposal

whitehat92 opened this issue · 3 comments

Would it be possible to add a list option, instead of a simple query? This could make it easier to automate some cases.
Thank you

No, I don't think I'll add this option, I don't really see any benefits. But it would be trivial to just combine the rsults in a big list. Let me give you an example,

from search_engines import Google

queries = ['q1', 'q2']
results = [Google().search(q) for q in queries]
print([i for r in results for i in r.links()])

Does this do what you're looking for?

Apparently yes, if the queries variable could read from the command line argument. Which script could I edit in order to add this snippet you suggested? It would have to be added to every search engine .py on engines folder, right?
Thank you

Not necessarily, I think it can by done by adding a for loop here https://github.com/tasos-py/Search-Engines-Scraper/blob/master/search_engines_cli.py#L35, right after the else statement. Just split args.q by a separator and iterate over the items.