我有一些无法登录到这个网站:https://illinoisjoblink.illinois.gov/ada/r/home登录网站与Python要求
我能够提交有效载荷,但我重定向到自称书签错误的页面。这里是代码和相关的错误消息。我不知道如何继续。我感谢任何和所有的帮助。谢谢!
session = requests.Session()
soup = BeautifulSoup(session.get(SEARCH_URL).content, "html.parser")
inputs = soup.find_all('input')
token = ''
for t in inputs:
try:
if t['name'] == 'authenticity_token':
token = t['value']
break
except KeyError as e:
pass
login_data = dict(v_username=USER_NAME,
v_password=PASSWORD,
authenticity_token=token,
commit='Log In')
login_data['utf-8'] = '✓'
r = session.post(LOGIN_URL, data=login_data)
print(r.content)
Bookmark Error <b>You may be seeing this error as a result of bookmarking this page. Unfortunately, our site design will not allow the bookmarking of most internal pages.</b> If you wish to contact the system administra tor concerning this error, you may send an email to <a href="mailto:[email protected]">[email protected]</a>. Please reference error number <b>646389</b>.<p>Thank you for your patience.<br><br> Hit your browser back button to return to the previous page.
谢谢你的回应。我将这些参数包含在我的字典中,但似乎没有帮助。但是,当我摆脱'login_data ['utf-8'] ='&#x2713;'登录根本不起作用,并且我被重定向到原始登录页面。另外,当我检查POST登录时,我没有看到'FormName',''fromlogin'和'button'的位置。 – MvTvP