Mechanize::Page
Inherits Mechanize::ElementMatcher / Mechanize::File / Reference / Object
This class represents the result of http response.
If you send a request, it returns the instance of Mechanize::Page.
You can get status code, title, and page body, and search html node using css selector from page instance.
Constructors
Instance methods
forms_with(criteria : String | NamedTuple | Hash(String, String))
search forms which match condition.
Examples
# if you specify String like "foo", it searches form which name is "foo".
# like <form name="foo"></form>
page.forms_with("foo")
# you can also specify tag's attribute and its' value by NamedTuple or Hash(String, String).
# ex) <form class="foo"></form>
page.forms_with("class" => "foo")
page.forms_with(class: "foo")
forms_with(criteria, &)
Sourcelinks
return all links(Mechanize::PageContent::Link) in the page.
page.links # => Array(Mechanize::PageContent::Link)
mech
Sourceparser
parser to parse response body. TODO: now it's Lexbor::Parser. I want to also support other parsers like JSON.