TypeError: 'NoneType' object is not subscriptable
Closed this issue · 6 comments
Yunak commented
Traceback (most recent call last):
File "d:\Users\wangy\Desktop\cpdaily-api\login.py", line 33, in <module>
lt = BeautifulSoup(response.text, features='html.parser').select_one('#lt')['value']
TypeError: 'NoneType' object is not subscriptable
jerryshell commented
你可以在 33 行的前面把
response.text
BeautifulSoup(response.text, features='html.parser').select_one('#lt')
这两个变量打印出来看看
Yunak commented
D:\Users\wangy\Desktop\cpdaily-api> cd d:\Users\wangy\Desktop\cpdaily-api && cmd /C "python c:\Users\wangy\.vscode\extensions\ms-python.python-2020.9.114305\pythonFiles\lib\python\debugpy\launcher 4023 -- d:\Users\wangy\Desktop\cpdaily-api\login.py "
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=renderer content=webkit><meta http-equiv=X-UA-Compatible content="IE=edge,Chrome=1"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover"><meta http-equiv=Pragma content=no-cache><meta http-equiv=Cache-Control content=no-cache><meta http-equiv=Expires content=0><title>统一身份认证平台</title><link rel=stylesheet
href=//wecloud-fe-res.oss-cn-hangzhou.aliyuncs.com/platform/core.css><link rel=stylesheet href=//wecloud-fe-res.oss-cn-hangzhou.aliyuncs.com/platform/extends.css><script src=//wecloud-fe-res.oss-cn-hangzhou.aliyuncs.com/platform/core.js></script><script src=//wecloud-fe-res.oss-cn-hangzhou.aliyuncs.com/platform/extends.js></script><script src=./script/encrypt.js></script><link href=/iap/login/css/2.3417c491.css rel=prefetch><link href=/iap/login/css/7.562c2e20.css rel=prefetch><link href=/iap/login/css/8.b955ce2d.css rel=prefetch><link href=/iap/login/css/9.31e73c81.css rel=prefetch><link href=/iap/login/js/2.754573a7.js rel=prefetch><link href=/iap/login/js/7.5721bb2e.js rel=prefetch><link href=/iap/login/js/8.4466ef70.js rel=prefetch><link href=/iap/login/js/9.c967f22e.js rel=prefetch><link href=/iap/login/css/chunk-common.0613d508.css rel=preload as=style><link href=/iap/login/css/chunk-vendors.0d2d812d.css rel=preload as=style><link href=/iap/login/css/mobile.b40db598.css rel=preload as=style><link href=/iap/login/js/chunk-common.32bc7660.js rel=preload as=script><link href=/iap/login/js/chunk-vendors.b00eafd4.js rel=preload as=script><link href=/iap/login/js/mobile.4824f72e.js rel=preload as=script><link href=/iap/login/css/chunk-common.0613d508.css rel=stylesheet><link href=/iap/login/css/chunk-vendors.0d2d812d.css rel=stylesheet><link href=/iap/login/css/mobile.b40db598.css rel=stylesheet></head><body><noscript><strong>We're sorry but vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/iap/login/js/chunk-common.32bc7660.js></script><script src=/iap/login/js/chunk-vendors.b00eafd4.js></script><script src=/iap/login/js/mobile.4824f72e.js></script></body></html>
None
jerryshell commented
看来官方已经把登录页面用 Vue 重写了,数据的获取改成了用 JS 异步请求获取
已经不能单纯的使用 BeautifulSoup 从页面中提取数据了
Yunak commented
嗷吼,好吧
jerryshell commented
我现在已经毕业成为一名社畜了,这个 APP 也早就卸载了,这个项目可能不会再更新了
如果你有心接手的话我会修改 README 把你的仓库地址贴上去
jerryshell commented
Close inactive issue.