Advertisement
Guest User

Untitled

a guest
Feb 26th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. require 'open-uri'
  2. require 'nokogiri'
  3. require 'rubygems'
  4. require 'watir-webdriver'
  5. b = Watir::Browser.new :firefox
  6. b.goto "http://zigzag.github.com/2010/03/31/grep-in-ruby----a-powerful-enumerable-method.html"
  7. ##b.text_field(:name => "q").set "Watir"
  8. ##b.button(:name => "btnK").click
  9. @full_html = b.text
  10. b.close
  11. @doc = Nokogiri::HTML(@full_html)
  12. puts @doc.xpath('//*[@id="dsq-global-toolbar"]/ul[2]/li[3]/ul/li[2]')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement