Giter Club home page Giter Club logo

cdut_selectcourse's Introduction

                                                       _oo0oo_
                                                      o8888888o
                                                      88" . "88
                                                      (| -_- |)
                                                      0\  =  /0
                                                    ___/`---'\___
                                                  .' \\|     |// '.
                                                 / \\|||  :  |||// \
                                                / _||||| -:- |||||- \
                                               |   | \\\  -  /// |   |
                                               | \_|  ''\---/''  |_/ |
                                               \  .-\__  '-'  ___/-. /
                                             ___'. .'  /--.--\  `. .'___
                                          ."" '<  `.___\_<|>_/___.' >' "".
                                         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
                                         \  \ `_.   \_ __\ /__ _/   .-` /  /
                                     =====`-.____`.___ \_____/___.-`___.-'=====
                                                       `=---='


                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                               菩提本无树   明镜亦非台
                                               本来无BUG    何必常修改

cdut_selectcourse's People

Contributors

zaxtyson avatar

Stargazers

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

Watchers

 avatar

cdut_selectcourse's Issues

Bug: The newly added anti-spider mechanism may block spider from logging in

我正在做爬取课表的应用程序,在研究教务处网站的相关代码的同时有幸拜读了阁下的代码。

教务处似乎加入了反爬虫机制,现在必须先获得两个 Cookie,根据这两个 Cookie 请求登录 API 才能成功。这点我在 Chrome 的控制台使用 Fetch API 测试过,是没问题的。

不然会报 HTTP 412 错误。

错误信息
截屏2021-09-12 15 24 24

两个先决 Cookie
两个先决 Cookie

但是两个先决 Cookie 并非用 requests 简单 GET 一下就能获取到。
使用 requests 简单 GET 之后获得的仅有两个先决 Cookie 的其中之一。

只能获取到一个先决 Cookie
截屏2021-09-12 15 28 08

但是很不巧的是,页面的 JavaScript 是经过混淆加密的,面对这些经过加密的 JS 我无从下手。

所以只好使用折中的办法:使用 selenium webdriver 调用真实浏览器来获得先决 Cookie。
详情参见 [Python]爬虫+动态cookie获取,Cookie

问题还是没有得到解决。在非浏览器环境使用两个先决 Cookie ,仍然返回的是 HTTP 400

如果阁下有好的处理方法,请务必告知在下!

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.