<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -17,7 +17,7 @@ task &quot;cleanup_readme&quot; =&gt; [&quot;rdoc&quot;]
 
 gem_spec = Gem::Specification.new do |s|
   s.name = 'scrubyt'
-  s.version = '0.4.26'
+  s.version = '0.4.30'
   s.summary = 'A powerful Web-scraping framework built on Mechanize and Hpricot (and FireWatir)'
   s.description = %{scRUBYt! is an easy to learn and use, yet powerful and effective web scraping framework. It's most interesting part is a Web-scraping DSL built on HPricot and WWW::Mechanize, which allows to navigate to the page of interest, then extract and query data records with a few lines of code. It is hard to describe scRUBYt! in a few sentences - you have to see it for yourself!}
   # Files containing Test::Unit test cases.</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -13,8 +13,8 @@ module Scrubyt
     module Firewatir
 
       def self.included(base)
-        base.module_eval do 
-          @@agent = FireWatir::Firefox.new
+        base.module_eval do
+          @@agent = FireWatir::Firefox.new unless defined? @@agent
           @@current_doc_url = nil
           @@current_doc_protocol = nil
           @@base_dir = nil
@@ -60,6 +60,11 @@ module Scrubyt
             store_host_name(@@agent.url)   # in case we're on a new host
           end
           
+          def self.use_current_page
+            @@mechanize_doc = &quot;&lt;html&gt;#{@@agent.html}&lt;/html&gt;&quot;
+            @@hpricot_doc = Hpricot(PreFilterDocument.br_to_newline(@@mechanize_doc))
+          end
+          
           def self.frame(attribute, value)
             if @@current_frame
               @@current_frame.frame(attribute, value)
@@ -111,7 +116,24 @@ module Scrubyt
             @@mechanize_doc = &quot;&lt;html&gt;#{@@agent.html}&lt;/html&gt;&quot;
             @@hpricot_doc = Hpricot(PreFilterDocument.br_to_newline(@@mechanize_doc))
             Scrubyt.log :ACTION, &quot;Fetching #{@@current_doc_url}&quot;
-          end          
+          end    
+          
+          def self.click_by_xpath_if_exists(xpath, wait_secs=0)
+            begin
+              result_page = @@agent.element_by_xpath(xpath).click
+              sleep(wait_secs) if wait_secs &gt; 0
+              @@agent.wait
+              
+              extractor.evaluate_extractor
+              
+              @@current_doc_url = @@agent.url
+              @@mechanize_doc = &quot;&lt;html&gt;#{@@agent.html}&lt;/html&gt;&quot;
+              @@hpricot_doc = Hpricot(PreFilterDocument.br_to_newline(@@mechanize_doc))
+              Scrubyt.log :ACTION, &quot;Fetching #{@@current_doc_url}&quot;              
+            rescue Watir::Exception::UnknownObjectException
+              Scrubyt.log :INFO, &quot;XPath #{xpath} doesn't exist in this document&quot;
+            end
+          end      
 
           def self.click_by_xpath(xpath, wait_secs=0)
             Scrubyt.log :ACTION, &quot;Clicking by XPath : %p&quot; % xpath        </diff>
      <filename>lib/scrubyt/core/navigation/agents/firewatir.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,6 +56,10 @@ module Scrubyt
     def fetch(*args)
       FetchAction.fetch(*args)
     end
+    
+    def use_current_page
+      FetchAction.use_current_page
+    end
     ##
     #Submit the current form
     def submit(index=nil, type=nil)
@@ -76,6 +80,10 @@ module Scrubyt
       FetchAction.click_link(link_spec, 0, sleep_secs)      
     end
     
+    def click_by_xpath_if_exists(xpath, sleep_secs=0)
+      FetchAction.click_by_xpath_if_exists(xpath, sleep_secs)
+    end
+    
     def click_by_xpath(xpath)
       FetchAction.click_by_xpath(xpath)
     end</diff>
      <filename>lib/scrubyt/core/navigation/navigation_actions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 Gem::Specification.new do |s|
   s.name = %q{scrubyt}
   s.summary = &quot;A powerful Web-scraping framework built on Mechanize and Hpricot (and FireWatir)&quot;
-  s.version = &quot;0.4.28&quot; 
+  s.version = &quot;0.4.30&quot; 
   s.authors = [&quot;Peter Szinek&quot;, &quot;Glenn Gillen&quot;]
   s.date = %q{2009-01-31}
   s.description = %q{scRUBYt! is an easy to learn and use, yet powerful and effective web scraping framework. It's most interesting part is a Web-scraping DSL built on HPricot and WWW::Mechanize, which allows to navigate to the page of interest, then extract and query data records with a few lines of code. It is hard to describe scRUBYt! in a few sentences - you have to see it for yourself!}</diff>
      <filename>scrubyt.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e47fe28ded618acafe5f9c86d34ac0cb4a008c96</id>
    </parent>
  </parents>
  <author>
    <name>Peter Szinek</name>
    <email>peter@rubyrailways.com</email>
  </author>
  <url>http://github.com/scrubber/scrubyt/commit/3eef63564a8838fc9266658baf0823976b224eaf</url>
  <id>3eef63564a8838fc9266658baf0823976b224eaf</id>
  <committed-date>2009-05-25T10:07:26-07:00</committed-date>
  <authored-date>2009-05-25T10:07:26-07:00</authored-date>
  <message>Added some new navigation actions (FireWatir only)</message>
  <tree>a81efb082802fb3563012f08353c4916bce974f8</tree>
  <committer>
    <name>Peter Szinek</name>
    <email>peter@rubyrailways.com</email>
  </committer>
</commit>
