Skip to main content

A pure-python headless browser

Project description

https://travis-ci.org/jelford/activesoup.svg?branch=master https://img.shields.io/pypi/v/activesoup.svg?maxAge=2592000

A simple library for interacting with the web from python

Description

activesoup combines familiar python web capabilities for convenient headless “browsing” functionality:

  • Modern HTTP support with requests - connection pooling, sessions, …

  • Convenient access to the web page with an interface inspired by beautifulsoup - convenient HTML navigation.

  • Robust HTML parsing with html5lib - parse the web like browsers do.

Use cases

Consider using activesoup when:

  • You need to actively interact with some web-page from Python (e.g. submitting forms, downloading files)

  • You don’t control the site you need to interact with (if you do, just make an API).

  • You don’t need javascript support (you’ll need selenium or phantomjs).

Usage examples

Log into a website, and download a CSV file that’s access-protected:

from activesoup import driver

d = driver.Driver()
login_page = d.get('https://my-site.com/login')
login_form = login_page.form
member_portal = login_form.submit({'username': secret_store['username'],
                    'password': secret_store['password']})

if member_portal.response.status_code not in range(200, 300):
    raise RuntimeError("Couldn't log in")

# Logged in now

csv_report = d.get('/members_area/file.csv')
csv_report.save_to('~/interesting_resport.csv')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

activesoup-0.0.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

activesoup-0.0.4-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file activesoup-0.0.4.tar.gz.

File metadata

  • Download URL: activesoup-0.0.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for activesoup-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b42270967b88d9fdb81e70bdec00dd18f5fb5740b8a958495edf654b9fd47f4b
MD5 7865e97a1eb3af52169e669759fc5d6d
BLAKE2b-256 b453b313e4b9dd91d17e6d434f7bf0ff97a7343e33b7929ab15421a7f086f80d

See more details on using hashes here.

File details

Details for the file activesoup-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for activesoup-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 35c7d3d59303008a7df22b5359b45a2fef1a61c1e736dbd14113d2e7f71d6a92
MD5 816e29871b11618efd3370e1914e0a7c
BLAKE2b-256 08b4b4dac426b78c27b8ba3e35f990acd0d727350184d7362f5dfbcc0280f8b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page