gpt4 book ai didi

Python 网页抓取 (edX)

转载 作者:行者123 更新时间:2023-11-30 22:11:41 25 4
gpt4 key购买 nike

我正在尝试下载 edx 上的类(class)。请参阅以下自述文件 ( https://github.com/coursera-dl/edx-dl/blob/master/README.md )。我安装了 Anaconda for Windows(我在并行桌面中运行 Windows 10)。

在最后一步中,我输入了以下命令:C:\edx-dl-master\edx-dl-master>edx-dl -u user@user.com COURSE-URL 并输入我的 edX 密码后,得到以下内容:

为将来的请求构建初始 header 。获取初始 CSRF token 。找到 CSRF token 。登录 Open edX 站点:https://courses.edx.org/login_ajax从仪表板提取类(class)信息。

Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\runpy.py", line 193, in
_run_module_as_main
"__main__", mod_spec)
File "c:\programdata\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\Scripts\edx-dl.exe\__main__.py", line 9, in <module>
File "c:\programdata\anaconda3\lib\site-packages\edx_dl\edx_dl.py", line 1011, in main
for selected_course in selected_courses}
File "c:\programdata\anaconda3\lib\site-packages\edx_dl\edx_dl.py", line 1011, in <dictcomp>
for selected_course in selected_courses}
File "c:\programdata\anaconda3\lib\site-packages\edx_dl\edx_dl.py", line 186, in get_available_sections
sections = page_extractor.extract_sections_from_html(page, BASE_URL)
File "c:\programdata\anaconda3\lib\site-packages\edx_dl\parsing.py", line 403, in extract_sections_from_html
for i, section_soup in enumerate(sections_soup, 1)]
File "c:\programdata\anaconda3\lib\site-packages\edx_dl\parsing.py", line 403, in <listcomp>
for i, section_soup in enumerate(sections_soup, 1)]
File "c:\programdata\anaconda3\lib\site-packages\edx_dl\parsing.py", line 392, in _make_subsections
for i, s in enumerate(subsections_soup, 1)]
File "c:\programdata\anaconda3\lib\site-packages\edx_dl\parsing.py", line 392, in <listcomp>
for i, s in enumerate(subsections_soup, 1)]
AttributeError: 'NoneType' object has no attribute 'string'

我是 Python 新手,不确定可以采取哪些补救措施。

最佳答案

尝试

git clone https://github.com/coursera-dl/edx-dl/blob/master/README.md

先安装git。

关于Python 网页抓取 (edX),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51348286/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com