Skip to main content

UNKNOWN

Project description

Introduction

lxmlmechanize is an efficient, i18n-aware, simple, lxml-based HTTP user-agent.

Synopsis

from lxmlmechanize import default_keychain, Mechanize
from lxmlmechanize.urllib2ext import Credentials

m = Mechanize()

# set credentials for authentication
default_keychain.add(Credentials('http://localhost:12345/', realm=None, user='test', password='testtest'))

# navigate to the page
m.navigate('http://localhost:12345/')

# populate the form fields
form = m.page.root.xpath('body//form[@id="test"]')[0]
form.xpath('input[@name="user"]')[0].set('value', 'user')
form.xpath('input[@name="password"]')[0].set('value', 'password')

# submit the form
m.submit_form(form)

Changelog

0.0.0

  • Initial

0.0.1

  • Store the headers and HTTP status of the last request to Mechanize object as headers and status respectively.

0.0.2

  • Make the loader factory customizable.

0.0.3

  • Fixed parsing of HTML5 document.

Download files

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

Files for lxmlmechanize, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size lxmlmechanize-0.0.3.tar.gz (13.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page