Skip to content

有关识别课程目录以及课程视频问题 #13

@B3eStCcc

Description

@B3eStCcc

今天测试中发现获取课程目录的时候,课程没有加载出来Chrome就直接闪退,不知道是自己网络问题还是网站更新后的问题,后来修改get课程代码得以解决 修改如下

await page.goto(url, {
waitUntil: 'networkidle0' // 网络空闲说明加载完毕
});

然后在获取课程学习内容进度的时候,在进行到某一科目的时候会报以下错误

Unhandled Rejection at: Promise Promise {
Error: Error: failed to find element matching selector ".activity-title > a.title"
at ElementHandle.$eval (D:\Ouchn\auto-study-master\node_modules\puppeteer-core\lib\cjs\puppeteer\common\JSHandle.js:880:19)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async getCourseDetail (D:\Ouchn\auto-study-master\src\getCourseDetail.js:35:19)
at async getData (D:\Ouchn\auto-study-master\src\getData.js:13:24)
at async D:\Ouchn\auto-study-master\src\index.js:59:3
} reason: Error: Error: failed to find element matching selector ".activity-title > a.title"
at ElementHandle.$eval (D:\Ouchn\auto-study-master\node_modules\puppeteer-core\lib\cjs\puppeteer\common\JSHandle.js:880:19)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async getCourseDetail (D:\Ouchn\auto-study-master\src\getCourseDetail.js:35:19)
at async getData (D:\Ouchn\auto-study-master\src\getData.js:13:24)
at async D:\Ouchn\auto-study-master\src\index.js:59:3

请问需要如何解决? 万分感谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions