Robotic browser
Robotic web browser. Represents HTTP requests and responses using the requests library and parsed HTML using BeautifulSoup.
Find a click a link by tag, pattern, and/or BeautifulSoup arguments.
Parameters: | value – BeautifulSoup tag, string, or regex. If tag, follow its href; if string or regex, search parsed document for match. |
---|
Go forward in browser history.
Parameters: | n (int) – Number of pages to go forward |
---|
Find form by ID, as well as standard BeautifulSoup arguments.
Parameters: | id (str) – Form ID |
---|---|
Returns: | BeautifulSoup tag if found, else None |
Find forms by standard BeautifulSoup arguments.
Returns: | List of BeautifulSoup tags |
---|
Find an anchor or button by containing text, as well as standard BeautifulSoup arguments.
Parameters: | text – String or regex to be matched in link text |
---|---|
Returns: | BeautifulSoup tag if found, else None |
HTML forms
Representation of an HTML form.
Serialize each form field and collect the results in a dictionary of dictionaries. Different fields may serialize their contents to different sub-dictionaries: most serialize to data, but file inputs serialize to files. Sub-dictionary keys should correspond to parameters of requests.Request.
Return dict: | Dict-of-dicts of serialized data |
---|
HTML form fields
Multiply inherit from ValueMeta and ABCMeta; classes with this metaclass are automatically assigned a value property and can use methods fromABCMeta (e.g. abstractmethod).
return a type’s method resolution order
Register a virtual subclass of an ABC.