Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 无法使用request.Session()登录。post_Python_Python 3.x_Web Scraping_Python Requests - Fatal编程技术网

Python 无法使用request.Session()登录。post

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

我无法使用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='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)