rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.7k stars 122 forks source link

Can`t connect to Chrome instance #308

Closed dunaevv closed 1 year ago

dunaevv commented 1 year ago

I am start Chrome from terminal with command:google-chrome --remote-debugging-port=9222 Then am running my script:

require "ferrum"

chrome = Ferrum::Browser.new(
    ws_url: "ws://127.0.0.1:9222/devtools/browser/d94452f3-ce73-45e7-b680-db14f13b5b0f", 
    headless: false, 
    # browser_options: { 
    #     "disable-blink-features": "AutomationControlled",
    #     "no-sandbox": false,
    #     "incognito": false
    # }
)

chrome.go_to("https://bot.sannysoft.com")
chrome.screenshot(path: "pic.png")
browser.quit

And its run a new Chrome

route commented 1 year ago

There’s no ws_url option only url