Skip to content

Setting content directly does not allow for use of DOM queries #304

@AlexMuir

Description

@AlexMuir

I have an issue when trying to set the content of a page using content=

Example (using Ferrum 0.12)

browser = Ferrum::Browser.new
page = @browser.create_page

# Works as expected
page.go_to 'https://google.com'
page.at_css("a") # => #<Ferrum::Node ... >

# Raises an exception and cannot find node
page.content = "<html><body><a href='#'>Test</a></body></html>"
page.at_css("a") # => Could not find node with given id (Ferrum::NodeNotFoundError)

# Yet the body has certainly updated - it's as though the DOM isn't refreshed
puts page.body # => "<html><head></head><body><a href=\"#\">Test</a></body></html>"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions