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