Skip to content

Instantly share code, notes, and snippets.

@Schizo
Created January 1, 2019 08:29
Show Gist options
  • Save Schizo/af10b3db4388b998d5530b1216392b60 to your computer and use it in GitHub Desktop.
Save Schizo/af10b3db4388b998d5530b1216392b60 to your computer and use it in GitHub Desktop.
Python - get all input fields of a login page
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