如何在python上通过硒控制网页?

问题描述 投票:0回答:1

我正在网页上,我想与之交互,我知道硒是最好的硒,但我不知道如何使用它。我完成的唯一步骤是pip install selenium。我收到未定义的Web驱动程序之类的错误。 Selenium文档很难理解,我的默认浏览器是Opera

from selenium import webdriver
driver = webdriver.Opera()
driver.get('https://www.google.co.in/search?client=opera&q=google&sourceid=opera&ie=UTF-8&oe=UTF-8')
python selenium
1个回答
0
投票

为了使Selenium知道如何与浏览器交互,需要一个驱动程序-参见this section of the documentation。>>

© www.soinside.com 2019 - 2024. All rights reserved.