代码: 120 print(r.text) 错误: <!doctype html><html lang="en"><head><title>HTTP Status 403 – Forbidden</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}</style></head><body><h1>HTTP Status 403 – Forbidden</h1><p>Type Status Report</p><p>Description The server understood the request but refuses to authorize it.</p><h3>Apache Tomcat/7.0.96</h3></body></html> Traceback (most recent call last): File "/py/xxt.py", line 423, in <module>
print(run_local())
File "/py/xxt.py", line 386, in run_local
if not s.set_cookies():
File "/py/xxt.py", line 59, in set_cookies
if self.login():
File "/py/xxt.py", line 121, in login
if json.loads(r.text)['result']:
File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
代码: 120 print(r.text) 错误: <!doctype html><html lang="en"><head><title>HTTP Status 403 – Forbidden</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}</style></head><body><h1>HTTP Status 403 – Forbidden</h1><p>Type Status Report</p><p>Description The server understood the request but refuses to authorize it.</p><h3>Apache Tomcat/7.0.96</h3></body></html> Traceback (most recent call last): File "/py/xxt.py", line 423, in <module>
print(run_local()) File "/py/xxt.py", line 386, in run_local
if not s.set_cookies(): File "/py/xxt.py", line 59, in set_cookies
if self.login(): File "/py/xxt.py", line 121, in login
if json.loads(r.text)['result']: File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s) File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
似乎现在不能用了吧 说签到任务正在排队 但是不见签到效果
老哥:http://101.89.182.58:9090/sign你的接口歇菜了,直接调用不会签到了,爷的青春结束了
测试了下,正常的
大佬 求救 api版本
ERROR: Traceback (most recent call last):
File "./cloud_sign.py", line 240, in interface
File "./cloud_sign.py", line 30, in init
File "./db_handler.py", line 11, in init
File "/usr/local/lib64/python3.6/site-packages/pymongo/collection.py", line 1273, in find_one
File "/usr/local/lib64/python3.6/site-packages/pymongo/cursor.py", line 1156, in next
File "/usr/local/lib64/python3.6/site-packages/pymongo/cursor.py", line 1050, in _refresh
File "/usr/local/lib64/python3.6/site-packages/pymongo/mongo_client.py", line 1810, in _ensure_session
File "/usr/local/lib64/python3.6/site-packages/pymongo/mongo_client.py", line 1763, in __start_session
File "/usr/local/lib64/python3.6/site-packages/pymongo/mongo_client.py", line 1796, in _get_server_session
File "/usr/local/lib64/python3.6/site-packages/pymongo/topology.py", line 485, in get_server_session
File "/usr/local/lib64/python3.6/site-packages/pymongo/topology.py", line 209, in _select_servers_loop
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused
大佬,请问api版怎么弄自定义位置
大佬你好,我在服务器用local脚本可以正常签到,但是用了api之后,访问接口提示错误码4000未知错误,用了你的api也提示一样的错误,怎么办OωO
用我的接口也报错?我自己试了下,没问题
对的,用你的接口也报错,就是4000未知错误
更新了api版本的,再试试看吧
今天又再次尝试了,还是返回相同的信息 XD
{
"msg": 4000,
"detail": "未知错误"
}
这是api返回的
带佬啊,好像接口失效了呀,咋个搞呀
好了,有些时候不知道怎么回事,没找到原因。
用稳定的话,可以自己部署一个api
Traceback (most recent call last):
File "/py/xxt.py", line 356, in <module>
File "/py/xxt.py", line 341, in local_run
File "/py/xxt.py", line 53, in init
File "/py/xxt.py", line 107, in login
File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
centos7 用py3.6也是错误,博主py用的什么版本呢,win上面3.6+的几个版本都是这样的问题
修改过脚本吗
341行代码
s = json.load(AutoSign(user_info['username'], user_info['password']))
这个脚本里,没有这样的写法。
Traceback (most recent call last):
File "/py/xxt.py", line 422, in <module>
File "/py/xxt.py", line 385, in run_local
File "/py/xxt.py", line 59, in set_cookies
File "/py/xxt.py", line 120, in login
File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
有可能之前是修改了一点东西,我又重新运行了一下,用的py3.6,centos7.3.还是
s = AutoSign(user_info['username'], user_info['password'], user_info['schoolid'])
之前这一行是这样的,报错了,所以尝试修改了一下,博主你的环境是什么
像是库的问题
在120行 print 输出下
r.text
print(r.text) 看下内容是什么r.text如果是一个字典,json库,正常转换
但是这里报错了,所以想知道下,这个内容是什么
我重新编辑一下
代码:
120 print(r.textprint(r.text))
121 if json.loads(r.text)['result']:
122 print("登录成功")
错误信息:
Traceback (most recent call last):
File "/py/xxt.py", line 423, in <module>
File "/py/xxt.py", line 386, in run_local
File "/py/xxt.py", line 59, in set_cookies
File "/py/xxt.py", line 120, in login
AttributeError: 'Response' object has no attribute 'textprint'
代码:
120 print(r.text)
错误:
<!doctype html><html lang="en"><head><title>HTTP Status 403 – Forbidden</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}</style></head><body><h1>HTTP Status 403 – Forbidden</h1><p>Type Status Report</p><p>Description The server understood the request but refuses to authorize it.</p><h3>Apache Tomcat/7.0.96</h3></body></html>
Traceback (most recent call last):
File "/py/xxt.py", line 423, in <module>
File "/py/xxt.py", line 386, in run_local
File "/py/xxt.py", line 59, in set_cookies
File "/py/xxt.py", line 121, in login
File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
好的,你现在直接访问这个链接看下是否正常,填写账号密码
https://passport2.chaoxing.com/api/login?name=账号&pwd=密码&schoolid=&verify=0
直接访问没问题{"result":true,"返回正常,我用的阿里云服务器,是不是超星给限制了
本地访问正常,代理服务器访问就是403了,应该是阿里云让学习通限制了。没想到是这个问题
阿里云 腾讯云请求访问 都会403
119 self.username, self.password), headers=self.headers)
121 if json.loads(r.text)['result']:120 print(r.textprint(r.text))
File "/py/xxt.py", line 423, in <module>
File "/py/xxt.py", line 386, in run_local
File "/py/xxt.py", line 59, in set_cookies
File "/py/xxt.py", line 120, in login
AttributeError: 'Response' object has no attribute 'textprint'
这样写:
print(r.text)
代码:
120 print(r.text)
错误:
<!doctype html><html lang="en"><head><title>HTTP Status 403 – Forbidden</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}</style></head><body><h1>HTTP Status 403 – Forbidden</h1><p>Type Status Report</p><p>Description The server understood the request but refuses to authorize it.</p><h3>Apache Tomcat/7.0.96</h3></body></html>
Traceback (most recent call last):
File "/py/xxt.py", line 423, in <module>
print(run_local())
File "/py/xxt.py", line 386, in run_local
if not s.set_cookies():
File "/py/xxt.py", line 59, in set_cookies
if self.login():
File "/py/xxt.py", line 121, in login
if json.loads(r.text)['result']:
File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
PS C:UserslaoranAppDataLocalProgramsPythonPython36> .python.exe a.py
cookies有效哦
Traceback (most recent call last):
File "a.py", line 356, in <module>
File "a.py", line 342, in local_run
File "a.py", line 298, in sign_tasks_run
File "a.py", line 141, in get_all_classid
File "C:UserslaoranAppDataLocalProgramsPythonPython36libsite-packagesbs4element.py", line 992, in getitem
KeyError: 'title'
win上面一直是这样的错误
Traceback (most recent call last):
File "C:/Users/doowy/Desktop/cloud_sign.py", line 7, in <module>
ModuleNotFoundError: No module named 'requests'
填入账号密码后运行,显示以上错误
需要安装模块
requests
使用指令
pip install requests
安装即可dalao,如何自己创建一个接口用来长期使用