Skip to main content

Allows to get an HTML, coming from several previous URLs. Sometimes this is needed to get webpages that requires cookies or a HTTP referrer to get a certain page.

Project description

Welcome to HTML-Jumping

Author:
  • Daniel Perez Rada <@dperezrada>

What?

Allows to get an HTML, coming from several previous URLs. Sometimes this is needed to get webpages that requires cookies or a HTTP referrer to get a certain page.

Pre-requisites

You will need:

To run the test you will also need:

  • lxml

Example

No proxy

from html_jumping import HtmlJumping
handler = HtmlJumping()
urls = [
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET'
    },
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET',
        'body': {
            'term': 'html_jumping',
            ':action': 'search',
            'submit': 'search'
        }
    }
]
received_header, received_content = handler.get(urls)

With proxy

Allow you to use a HTTP proxy, you will need to install the socksipy library.

from html_jumping import HtmlJumping
handler = HtmlJumping()
urls = [
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET'
    },
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET',
        'body': {
            'term': 'html_jumping',
            ':action': 'search',
            'submit': 'search'
        }
    }
]
received_header, received_content = handler.get(
    urls,
    proxy_info = {'host': '127.0.0.1', 'port': '8081'}
)

With permanent headers

This will sent in each call the headers ‘Accept-Language’.

from html_jumping import HtmlJumping
handler = HtmlJumping()
urls = [
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET'
    },
    {
        'url': 'http://pypi.python.org/pypi',
        'method': 'GET',
        'body': {
            'term': 'html_jumping',
            ':action': 'search',
            'submit': 'search'
        }
    }
]
received_header, received_content = handler.get(
    urls,
    permanent_headers = {'Accept-Language': 'es, en-cl;q=0.5'}
)

Tests

Run

>> nosetests

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

html_jumping-0.2.3.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file html_jumping-0.2.3.tar.gz.

File metadata

  • Download URL: html_jumping-0.2.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for html_jumping-0.2.3.tar.gz
Algorithm Hash digest
SHA256 06e1ba4dc4308b2d394d0373ec4da5970e0bce845bd6de8d4d0664ae8176ef31
MD5 8fe1532ffb66579e90d42c4492e33b5a
BLAKE2b-256 c691ee3b344ac2b1655cc7e7c1c4b0fcf437a9868743b61fda8426199e9274b0

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