Generally Mechanize will get a webpage from a URL and the result of the get method is a Mechanize::Page object, from which you can use a lot of useful methods.
If the page lives in a string, how do I get the same Mechanize::Page object?
require 'mechanize'
html = <<END_OF_STRING
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Page Title</title>
<style type="text/css">
</style>
</head>
<body>
<h1>This is a test</h1>
</body>
</html>
END_OF_STRING
agent = Mechanize.new
# How can I get the page result from the string html?
#page = ...