Python 无法使用request.Session()登录。post
我无法使用python成功通过此网页登录屏幕。我尝试了requests.Session().get和Selenium,但由于其他错误,目前我甚至无法使用Selenium 如果我可以通过使用请求登录,我更希望这样。我的代码如下:Python 无法使用request.Session()登录。post,python,python-3.x,web-scraping,python-requests,Python,Python 3.x,Web Scraping,Python Requests,我无法使用python成功通过此网页登录屏幕。我尝试了requests.Session().get和Selenium,但由于其他错误,目前我甚至无法使用Selenium 如果我可以通过使用请求登录,我更希望这样。我的代码如下: with requests.Session() as s: p = s.post('https://www.chartmill.com/login.php', data=dict( username='username', password='pa
with requests.Session() as s:
p = s.post('https://www.chartmill.com/login.php', data=dict(
username='username',
password='password',
))
我将非常感谢您的帮助,因为我无法解决任何问题。该表单还提交了
submitID=1
以及用户名
和密码
。尝试:
with requests.Session() as s:
p = s.post('https://www.chartmill.com/login.php', data=dict(
username='username',
password='password',
submitID=1
))
正在工作。您好,我仍然无法使用此代码通过登录页面。由于某种原因,自从我昨天试用了您的URL后,该网站现在已切换到基于AJAX的登录,因此
https://www.chartmill.com/login.php
不再有效。如果成功,请关闭问题,以便我获得“徽章”并告诉其他人解决此问题的可行方法。
import json
import requests
headers = {"Content-Type": "application/json"}
data={
'username':'username',
'password':"password",
}
with requests.Session() as s:
p = s.post('https://www.chartmill.com/chartmill-rest/member/login', data=json.dumps(data),headers=headers)
judge= s.get('https://www.chartmill.com/account.php?o=74375').text.find(username)
print(judge)