lib/bills.rb in my-congress-0.2.4 vs lib/bills.rb in my-congress-0.2.5
- old
+ new
@@ -6,10 +6,10 @@
bill_array = []
bills = page.css("table.table tr")
bill_each = page.css("table.table tr td")
x = 3
- while x < 20
+ while x < (4 + (bills.length - 1) * 4)
bill_hash = { }
bill_hash[:name] = bill_each[x].css("a").children.text
bill_hash[:congress] = bill_each[x-1].css("div").children.children.text
bill_hash[:bill_url] = bill_each[x].css("a")[0].attributes["href"].value
bill_hash[:bill_page] = Nokogiri::HTML(open("https://www.govtrack.us#{bill_hash[:bill_url]}"))
\ No newline at end of file