我如何解决这个 Selenium.common.exceptions.WebDriverException 错误?

时间:2021-07-13 23:59:54

标签: python selenium selenium-webdriver

我收到一个 WebDriverException 错误,说 chromedriver.exe 需要在路径中,但正如您在第二张图片中看到的,我已经这样做了。我也无法弄清楚“未知错误:DevToolsActivePort 文件不存在”)。附上错误。现在我正在使用这个网站 (https://christophegaron.com/scraping-linkedin-posts-with-selenium-and-beautiful-soup/) 将 Chrome 驱动程序和 Selenium 下载到我的笔记本电脑(我的笔记本电脑上已经有 BeautifulSoup,所以我不需要那个)。此外,我同时拥有 Ubuntu 和 Linux,因此我愿意使用其中任何一个来解决我的问题。我也在使用 Python 3.8.5、Ubuntu 20.04.2、Chrome 91 版和 Linux 4.4.0 版。

另外,如果有人有关于如何抓取 LinkedIn 帖子的任何提示,那将是惊人的!

picture of the errors/exceptions picture of code

1 个答案:

答案 0 :(得分:0)

感谢您的帮助!我发现我的错误是我在 Linux 机器上使用 Ubuntu(作为 VM),而我应该在自然机器上运行 Chromium 程序。