Git Product home page Git Product logo

Comments (5)

SigureMo avatar SigureMo commented on June 1, 2024

全部这样吗?删掉重试呢?使用文本编辑器打开看看,里面是二进制内容还是HTML的"页面错误"内容

from course-crawler.

SigureMo avatar SigureMo commented on June 1, 2024

有空加个Debug用的log文件吧 @Foair 把网址等信息,都记录下来,他这个还真不好测试……

from course-crawler.

Oshibuki avatar Oshibuki commented on June 1, 2024
<script> window.open("https://www.icourse163.org/course/attachment.htm?nosKey=970E89E9A7FD4BCECA750BB6CC1E99B6-1472021484929&fileName=HttpDemoAndPPT.zip",'_self'); </script>

这个是用notepad++打开后显示的

1.3.1 HttpDemoAndPPT.zip

from course-crawler.

SigureMo avatar SigureMo commented on June 1, 2024

喵?Σ(⊙▽⊙"a我直接用requests测试是可以下的,那个文件修改扩展名为HTML后打开也是自动跳转下载的,emmmmmmm不资到为撒能把那个页面download下来

from course-crawler.

SigureMo avatar SigureMo commented on June 1, 2024

问题在我的课程C++程序设计入门(下)重现
解决方法:
经测试,使用session的CANDY对课件进行下载将会重定向到一个页面后使用js进行下载,而直接使用requests则会直接下载内容,故可以直接使用requests下载或者使用参数将session注释掉,两者选择其一即可,建议使用第二种
1.

file_name = '%s %s' % (counter, file_name) # 下面是要修改的内容
with open(WORK_DIR.file(file_name), 'wb') as f:
    r = requests.get('https://www.icourse163.org/course/attachment.htm', params=params)
    f.write(r.content)
file_name = '%s %s' % (counter, file_name) # 下面是要修改的内容
CANDY.download_bin('https://www.icourse163.org/course/attachment.htm',
                                    WORK_DIR.file(file_name), params=params, cookies={'STUDY_SESS': None})

位置在study_mooc.py 167行左右

from course-crawler.

Related Issues (20)

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.