Genel Bakış, bir URL'den bir web sayfası alır ve get yönteminin sonucu, bir çok yararlı yöntem kullanabileceğiniz bir Mechanize :: Page nesnesidir. .Ruby Mechanize'ın bir dizede yaşayan bir sayfa almasına nasıl izin verilir?
Sayfa bir dizede yaşıyorsa, aynı Fileize :: Page nesnesini nasıl edinebilirim?
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 = ...