Created
January 1, 2019 08:29
-
-
Save Schizo/af10b3db4388b998d5530b1216392b60 to your computer and use it in GitHub Desktop.
Python - get all input fields of a login page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
r = requests.get("https://forums.testwebsite.net/login/") | |
soup = BeautifulSoup(r.content, 'html.parser') | |
data = {inputfield.attrs['name']: inputfield.attrs['value'] for inputfield in soup.find_all("input")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment