Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s0md3v/zetanize
HTML form parser for humans.
https://github.com/s0md3v/zetanize
mechanize
Last synced: 16 days ago
JSON representation
HTML form parser for humans.
- Host: GitHub
- URL: https://github.com/s0md3v/zetanize
- Owner: s0md3v
- License: mit
- Created: 2018-10-27T03:43:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-15T15:30:21.000Z (over 4 years ago)
- Last Synced: 2024-10-05T15:47:46.812Z (about 1 month ago)
- Topics: mechanize
- Language: Python
- Size: 6.84 KB
- Stars: 75
- Watchers: 5
- Forks: 20
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
zetanize
HTML Form Parser For Humans
### Introduction
It's very easy to make HTTP requests in python, thanks to urllib and requests. However, there was no way to submit HTML forms on the go, well now there is.### Documentation
```python
from zetanize import zetanize
forms = zetanize(html)
```Well that's it! Just feed zetanize a HTML document and it will give you a dict of actionable form data.
Let's parse https://google.com for getting familiar:
```python
from requests import get
from zetanize import zetanizehtml = get('https://google.com').text
forms = zetanize(html)
```Here's the output:
```json
{
"0": {
"action": "/search",
"inputs": [
{
"type": "hidden",
"name": "ie",
"value": "ISO-8859-1"
},
{
"type": "hidden",
"name": "hl",
"value": "en-IN"
},
{
"type": "hidden",
"name": "source",
"value": "hp"
},
{
"type": "hidden",
"name": "biw",
"value": ""
},
{
"type": "hidden",
"name": "bih",
"value": ""
},
{
"type": "",
"name": "q",
"value": ""
},
{
"type": "submit",
"name": "btnG",
"value": "Google Search"
},
{
"type": "submit",
"name": "btnI",
"value": "I"
},
{
"type": "hidden",
"name": "gbv",
"value": "1"
}
],
"method": "get"
}
}
```