sookcha / every2cal Goto Github PK
View Code? Open in Web Editor NEWπμλΈλ¦¬νμ μΊλ¦°λλ₯Ό icsνμΌλ‘ λ°κΏμ€λλ€
πμλΈλ¦¬νμ μΊλ¦°λλ₯Ό icsνμΌλ‘ λ°κΏμ€λλ€
python every2cal.py --begin 2020-03-16 --end 2020-07-04
μλΈλ¦¬νμ μμ΄λ : *******
Password:
κ°μ Έμ¬ λ
λ : 2020
κ°μ Έμ¬ νκΈ° : 1
Traceback (most recent call last):
File "every2cal.py", line 30, in <module>
xml = e.get_timetable(year, semester)
File "C:\Users\Yoongi Kim\Downloads\every2cal\everytime.py", line 24, in get_timetable
tree = ElementTree.fromstring(timetable_result.text)
File "C:\conda\envs\ml\lib\xml\etree\ElementTree.py", line 1315, in XML
parser.feed(text)
xml.etree.ElementTree.ParseError: syntax error: line 1, column 0
The text
was empty because of 404 Not found error.
Is the program outdated?
I really appreciate this wonderful crawler!
But there's issue while using... so I make this issue and there's chance of pull-request if my time allow.
My environment is as following
And here's error traceback
Traceback (most recent call last):
File ".\every2cal.py", line 29, in <module>
xml = e.get_timetable(year, semester)
File "D:\Dev\Demo\every2cal\everytime.py", line 21, in get_timetable
token = soup.find(id="userToken")["value"]
TypeError: 'NoneType' object is not subscriptable
So I print the soup... but login was successful.
<!DOCTYPE html>
<html lang="ko">
<head>
<title>μλΈλ¦¬νμ</title>
...
<div class="leftside">
<div class="card pconly">
<form class="logged">
<img class="picture" src="https://cf-fpi.everytime.kr/0.png"/>
<p class="nickname">{MY_ID}</p>
<p class="school">{MY_NAME}</p>
<p class="school">{MY_NAME}</p>
<ul class="buttons">
<li><a href="/my">κ³μ μ€μ </a></li>
<li><a href="/user/logout">λ‘κ·Έμμ</a></li>
...
</body>
</html>
https://github.com/sookcha/every2cal/blob/2c63de8/everytime.py#L12-L16 μμ 403 μλ΅ μ½λλ₯Ό λ°μ timetable_result
μμ ꡬ문 λΆμμ νμ§ λͺ»νκ³ μμ΅λλ€.
λ€λ₯Έ λΆμ μΈμ¦ λ¨κ³κ° μ μ΄λ€μ§κ³ μλμ§ κΆκΈν©λλ€. payload νλμ½λ©κ³Ό urlencoeded λ₯Ό μλν΄λ³΄μμΌλ κ²°κ³Όλ κ°μμ΅λλ€.
μΈμ
μ κ΄λ¦¬νλ requests
λͺ¨λμ λ²μ μ λ ν¬μ§ν 리μ λͺ
μν 2.20.1
λ₯Ό μ¬μ©νμ΅λλ€.
β― python3 every2cal.py --begin 2021-03-02 --end 2021-06-21
μλΈλ¦¬νμ μμ΄λ :
Password:
κ°μ Έμ¬ λ
λ : 2021
κ°μ Έμ¬ νκΈ° : 1
Traceback (most recent call last):
File "~/github/sookcha/every2cal/every2cal.py", line 38, in <module>
main()
File "~/github/sookcha/every2cal/every2cal.py", line 31, in main
xml = e.get_timetable(year, semester)
File "~/github/sookcha/every2cal/everytime.py", line 23, in get_timetable
tree = ElementTree.fromstring(timetable_result.text)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/xml/etree/ElementTree.py", line 1348, in XML
return parser.close()
xml.etree.ElementTree.ParseError: no element found: line 1, column 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.