如您所见,只有一个用户名字段,然后单击submit后,您将被带到同一个页面,现在只有该字段用于输入密码。以下是我现有的不起作用的代码:import requests
import lxml.html
from bs4 import BeautifulSoup
# URL of webpage
login_url = "https://cas.tamu.edu/cas/login?service=https://howdy.tamu.edu/uPortal/Login&renew=true"
howdy = "https://howdy.tamu.edu/uPortal/normal/render.uP"
username = # my username
password = # my password
# create a session to store cookies
sesh = requests.session()
params = {'service': howdy}
# gets the URL and converts the text of the HTML code
req = sesh.get(login_url, params=params)
html_content = req.text
print html_content
# parsing the page for hidden inputs
login_html = lxml.html.fromstring(html_content)
hidden_inputs = login_html.x