4 ms·
I was surprised there's no way to query the page beyond the small list of element accessors you provide (body, url, scheme, host, port, title, description, link
by mapgrep 11y ago
I was surprised there's no way to query the page beyond the small list of element accessors you provide (body, url, scheme, host, port, title, description, links, images, meta).
When you're putting together a tool like this, it's nice to give the user some way to "escape" your framework and get to lower level underlying data.
Why not offer something like
page.selector('h2 p') #returns Nokogiri elements
page.h1 #calls method_missing, returns Nokogiri elements
page.p #ditto
page.noko #returns underlying Nokogiri doc
Also, you forgot to include the body accessor in the "Accessing inpsected data" portion of the doc.