Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

implemented shutdown sequence

  • Loading branch information...
commit 1f595b29555b1f920cc7f9302fb5cd408b8f08af 1 parent 4b30102
@jaredfolkins authored
Showing with 12 additions and 5 deletions.
  1. +12 −5 lib/bot.rb
View
17 lib/bot.rb
@@ -66,10 +66,6 @@ def emulate_javascript_set_cookie
@browser.get(HOST + "Search.asp")
end
- def get_supplied_year
-
- end
-
def submit_search_form
emulate_javascript_set_cookie
search_form = @browser.page.form("frmMain")
@@ -146,6 +142,13 @@ def run_loop
click_next_link(page)
#}
end
+ shutdown_sequence(@browser.page)
+ end
+
+ def shutdown_sequence(page)
+ puts 'Shutdown Activated!'
+ iterate_search_page(page)
+ puts 'Shutdown Complete!'
end
def traverse_tree_from_page(body)
@@ -271,7 +274,11 @@ def search_results_page?(page)
def next_link?(page)
url = page.body.to_s.match(/<a href=(Results\.asp\?START=\d+)>Next/i)
- page.link_with(:href => url[1]) ? true : false
+ if url.nil?
+ false
+ else
+ page.link_with(:href => url[1]) ? true : false
+ end
end
def get_document_pdf(pdf_url)
Please sign in to comment.
Something went wrong with that request. Please try again.