Junior Application Developer at indroid
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
requests-experiments
requests-simple.py
research.txt
selenium-complex.py
selenium-experiments

README.md

indroid-python-requests

  1. Make a function
    • accepts a string
    • returns the Google-results
    • use Python and the requests-module
  2. make a function
    • accepts a string
    • returns the Google results
    • use Python and Selenium
      • which controls a browser (default: Firefox).

requests-simple.py

Scrape Google search results with the requests python module.

Dependencies

  • python 2.7

Installation

```shell pip install requests git clone https://github.com/rainsdance/indroid-python-requests cd indroid-python-requests ```

Use

```shell python requests-simple.py ```

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.

selenium-complex.py

Scrape Google search results with Selenium based on https://github.com/DanMcInerney/search-google

Dependencies

  • python 2.7
  • Selenium

Installation

```shell pip install selenium git clone https://github.com/rainsdance/indroid-python-requests cd indroid-python-requests ```

Use

```shell python selenium-complex.py -s "foo bar test" ```

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.