-
require "ferrum"
browser = Ferrum::Browser.new ws_url: "ws://127.0.0.1:9222/devtools/browser/..."
node = browser.xpath("//*[contains(concat(' ',@class),' searchResultGroup_')]").first
p node.class
p node.text.size
xpath = ".//div" # any value, does not matter
node.at_xpath(xpath)Chrome: |
Beta Was this translation helpful? Give feedback.
Answered by
Nakilon
Jun 29, 2026
Replies: 2 comments
-
|
Seems like you have to do either |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Nakilon
-
|
Fixed in #596 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems like you have to do either
browser.pages.first.command "DOM.getDocument", depth: -1or explicitly visit some page beforehand after you connect to browser.