requests

What it is good for?

Retrieving webpages.

requests sends HTTP requests to web pages and allows you to read their content. Most standard tasks are a lot easier compared to the standard module urllib. requests can sending data to web forms via HTTP GET and POST, submit files and manage cookies.

Installed with Python by default

no

Installed with Anaconda

yes

Example

Read the homepage of the author.

  1. import requests
  2. r = requests.get('http://www.academis.eu')
  3. print(r.text)

Search scientific articles on PubMed:

  1. url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi"
  2. param_dict = {'db':'pubmed', 'term':'escherichia', 'rettype':'uilist'}
  3. r = requests.get(url, params=param_dict)
  4. print(r.text)

Where to learn more?

http://docs.python-requests.org/en/latest/index.html