Giter VIP home page Giter VIP logo

every2cal's People

Contributors

basicneural avatar ddkani avatar kyle-seongwoo-jun avatar minsoo0715 avatar sookcha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

every2cal's Issues

404 Not Found Error

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?

userToken not found error

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

  • Python 3.7.0b5
  • virtualenv on Windows 10

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.