ruby - 打开新标签后,ruby watir 中的无头 chrome 浏览器没有响应
问题描述
我在我的 linux 服务器上使用 chrome headless 进行网页抓取。我收到Selenium::WebDriver::Error::TimeOutError: timeout
错误
这是我的代码:
Selenium::WebDriver::Chrome.driver_path = "/usr/local/bin/chromedriver"
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--ignore-certificate-errors')
options.add_argument('--disable-popup-blocking')
options.add_argument('--disable-translate')
options.add_argument('--headless')
browser = Watir::Browser.new :chrome, options: options
browser.goto 'www.abc.com'
browser.link(text: 'hello').click! # opens in new window
browser.windows.last.use
browser.url # FAILING AT THIS POINT
错误
Selenium::WebDriver::Error::TimeOutError: timeout
(Session info: headless chrome=84.0.4147.105)
(Driver info: chromedriver=2.41.578700
解决方案
推荐阅读
- javascript - 将十六进制转换为浮点数 - JS 中的大端(ABCD)
- python - 没有 scikitlearn 的多项式回归
- javascript - 尝试分配非对象警告的属性,var 的问题
- css - 如何在酶中测试 CSS 悬停 - React
- api - DOTNET CORE JWT 将值“用户名”转换为类型“jwt_example.Model.LoginModel”时出错
- python - Matplotlib。Pyplot 不适用于 pycharm
- google-cloud-data-fusion - Google Data Fusion:“循环”输入数据,然后在每个输入行执行多个 Restful API 调用
- php - phpseclib 2.0 生成的签名与具有相同参数的任何其他库不同
- mysql - SQL开发与组合损失率
- vba - 为每张幻灯片分组形状/对象并在PowerPoint演示文稿中翻转它