
Welcome to MechanicalSoup’s documentation!¶
A Python library for automating interaction with websites. MechanicalSoup automatically stores and sends cookies, follows redirects, and can follow links and submit forms. It doesn’t do Javascript.
MechanicalSoup was created by M Hickford, who was a fond user of the Mechanize library. Unfortunately, Mechanize is incompatible with Python 3 and its development stalled for several years. MechanicalSoup provides a similar API, built on Python giants Requests (for http sessions) and BeautifulSoup (for document navigation). Since 2017 it is a project actively maintained by a small team including @hemberger and @moy.
Contents:
- Introduction
- MechanicalSoup tutorial
- The mechanicalsoup package: API documentation
- Frequently Asked Questions
- When to use MechanicalSoup?
- How do I get debug information/logs
- Should I use Browser or StatefulBrowser?
- How does MechanicalSoup compare to the alternatives?
- Form submission has no effect or fails
- My form doesn’t have a unique submit name. What can I do?
- “No parser was explicitly specified”
- “ReferenceError: weakly-referenced object no longer exists”
- External Resources
- Release Notes