html_jumping 0.2.1
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.
Latest Version: 0.2.2
Welcome to HTML-Jumping
| Author: |
|
|---|
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:
- httplib2
- http://socksipy.sourceforge.net/ (if you want to use a proxy)
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
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| html_jumping-0.2.1.tar.gz (md5) | Source | 2011-11-25 | 3KB | 189 | |
- Author: Daniel Perez Rada
- Home Page: https://github.com/dperezrada/html_jumping
- Keywords: html_jumping cookies html get post form referrer
- License: GNU Public License v3.0
- Categories
- Package Index Owner: dperezrada
- DOAP record: html_jumping-0.2.1.xml
