Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法获取cookie #1

Open
Lovecraftzhou opened this issue Sep 4, 2021 · 4 comments
Open

无法获取cookie #1

Lovecraftzhou opened this issue Sep 4, 2021 · 4 comments

Comments

@Lovecraftzhou
Copy link

temp = [<urllib.request.Request object at 0x0000020743EC6190>, <CookieJar[]>]
Traceback (most recent call last):
File "D:/Pycharm/StudentSchedule-main/StudentSchedule/StudentSchedule/StudentSchedule.py", line 144, in
html=mainFuction(LoginURL,URL,username,password)
File "D:\Pycharm\StudentSchedule-main\StudentSchedule\StudentSchedule\theSpider.py", line 99, in mainFuction
html=GetHtml(LoginURL,URL,username,password)
File "D:\Pycharm\StudentSchedule-main\StudentSchedule\StudentSchedule\theSpider.py", line 68, in GetHtml
resp = opener.open(req)
File "D:\Anaconda\envs\py38\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "D:\Anaconda\envs\py38\lib\urllib\request.py", line 640, in http_response
response = self.parent.error(
File "D:\Anaconda\envs\py38\lib\urllib\request.py", line 569, in error
return self._call_chain(*args)
File "D:\Anaconda\envs\py38\lib\urllib\request.py", line 502, in _call_chain
result = func(*args)
File "D:\Anaconda\envs\py38\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 412: Precondition Failed

为何temp中保存的cookie没有值

@aRuul
Copy link
Owner

aRuul commented Sep 4, 2021

temp = [<urllib.request.Request object at 0x0000020743EC6190>, <CookieJar[]>]
Traceback(最近一次调用):
文件“D:/Pycharm/StudentSchedule-main/StudentSchedule/StudentSchedule/StudentSchedule.py”,第144行, 在
html=mainFuction(LoginURL,URL,username,password)
文件“D:\Pycharm\StudentSchedule-main\StudentSchedule\StudentSchedule\theSpider.py”,第 99 行,在 mainFuction 中
html=GetHtml(LoginURL,URL,username,password )
文件“D:\Pycharm\StudentSchedule-main\StudentSchedule\StudentSchedule\theSpider.py”,第 68 行,在 GetHtml
resp = opener.open(req)
文件“D:\Anaconda\envs\py38\lib\urllib\request .py”,第 531 行,在 open
response = meth(req, response)
文件“D:\Anaconda\envs\py38\lib\urllib\request.py”,第 640 行,在
http_response response = self.parent.error(
文件“D:\Anaconda\envs\py38\lib\urllib\request. py", line 569, in error
return self._call_chain(*args)
File "D:\Anaconda\envs\py38\lib\urllib\request.py", line 502, in _call_chain
result = func(*args)
File " D:\Anaconda\envs\py38\lib\urllib\request.py”,第 649 行,在 http_error_default 中
引发 HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 412: Precondition Failed

为何temp中保存的cookie没有值

学校的教务处在上学期期末升级了呀,我这个代码是很早之前的,所以失效了吧,最近事情太多,也没有来的及维护

@Lovecraftzhou
Copy link
Author

ok,谢谢了

@aRuul
Copy link
Owner

aRuul commented Sep 4, 2021

ok,谢谢了

我刚才实验了一下,是可以用的,你在releases那里下载我打包好的zip文件就行,github上的源码不是最新的,我之前改完代码忘记提交了
image

@aRuul
Copy link
Owner

aRuul commented Jan 17, 2022

Jan 16, 2022 突然诈尸更新,添加了[成都理工大学]本地课表解析导出的功能,解决了无法登录教务处的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants