当代码到达浏览器命令时(例如填充文本字段),我收到此错误:
DevTools listening on ws://127.0.0.1:12509/devtools/browser/46b50917-1033-4861-b36d-50d3db9fc856
Logging in...
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok': unknown error: missing or invalid 'entry.level' (Selenium::WebDriver::Error::UnknownError)
(Session info: chrome=65.0.3325.181)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.17134 x86_64)
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/response.rb:32:in `initialize'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:84:in `new'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:84:in `create_response'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/default.rb:104:in `request'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:62:in `call'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/bridge.rb:166:in `execute'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/oss/bridge.rb:584:in `execute'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/oss/bridge.rb:552:in `find_element_by'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/common/search_context.rb:60:in `find_element'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/locators/element/locator.rb:286:in `locate_element'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/locators/element/locator.rb:76:in `using_watir'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/locators/element/locator.rb:35:in `locate'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:693:in `locate_in_context'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:583:in `locate'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:680:in `assert_exists'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:50:in `exists?'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:625:in `wait_for_exists'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:653:in `wait_for_enabled'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:664:in `wait_for_writable'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:794:in `check_condition'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/elements/element.rb:756:in `element_call'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/watir-6.14.0/lib/watir/user_editable.rb:10:in `set'
from C:/Users/Chiro/Desktop/files/Web-Scraping-Tutorial-master/auto_liker.rb:20:in `<main>'
答案 0 :(得分:0)
检查chrome版本,并相应地同步chrome驱动程序和版本。