During an interview with Indroid, the technical interview was a homework. The original email was quite intimidating, "1. make a function that accepts a string and returns the Google-results using python and the results-module. 2. make a function that accepts a string and returns the google results using python and selenium. Selenium controls a browser and uses Firefox as default."
One of the first things I did was re-arrange the two part assignment into smaller pieces for better google-a-bility (yes, it's a word):
- Make a function
- accepts a string
- returns the Google-results
- use Python and the requests-module
- make a function
- accepts a string
- returns the Google results
- use Python and Selenium
- which controls a browser (default: Firefox).
- python 2.7
Script prompts for a string (What would you like to search for?) and then an integer (How many results would you like to see?) and returns the unformatted google results.
Scrape Google search results with Selenium based on https://github.com/DanMcInerney/search-google- python 2.7
- Selenium
Will open the firefox browser, search for "foo bar test" on google.com and return one page of ten results with the title and url of each result.