Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created July 27, 2015 18:34
Show Gist options
  • Save leejarvis/5ae1b658d69ab60f3c62 to your computer and use it in GitHub Desktop.
Save leejarvis/5ae1b658d69ab60f3c62 to your computer and use it in GitHub Desktop.
$:.unshift './lib'
require 'mechanize'
require 'logger'
page = Mechanize::Page.new(URI("localhost"), nil, DATA.read, nil, Mechanize.new)
p page.search("#foo/text()").text #=> "hello"
__END__
<div id="foo">
hello
<div class="child">
world!
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment