首页 > 解决方案 > requests_html render() 抛出 OSError: [WinError 14001]

问题描述

您好,我正在尝试使用 python 模块 requests-html 进行网络抓取,以处理页面https://www.monster.com/jobs/search?q=Software+Engineer&where=上的动态内容。我的代码是:

from requests_html import HTMLSession
url = 'https://www.monster.com/jobs/search?q=Software+Engineer&where='
session = HTMLSession()
response = session.get(url)
response.html.render() 

但是当我运行 response.html.render() 我得到这个错误

OSError: [WinError 14001] The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail

我第一次运行 render() 我得到了

[W:pyppeteer.chromium_downloader] start chromium download.
Download may take a few minutes.
[W:pyppeteer.chromium_downloader]
chromium download done.
[W:pyppeteer.chromium_downloader] chromium extracted to: C:\Users\user\AppData\Local\pyppeteer\pyppeteer\local-chromium\588429

但是文件路径不存在,但 pyppeteer 实际上是一个已安装的包(pyppeteer==0.2.5)。有谁知道发生了什么?

标签: web-scrapingpython-requests-html

解决方案


您遇到此问题是因为铬设置失败。

您可以尝试重新安装 request_html,或者我所做的就是从 Windows 商店中的 python 切换到从 python 网站下载,然后再次安装 request_html。

在使用下载的 python 正确设置所有内容后,我从商店切换回 python 3.9,一切仍然正常。


推荐阅读