Skip to content

Commit

Permalink
Handle all strings representing vacant seats
Browse files Browse the repository at this point in the history
'vacant', '-vacant-' and '---' all seems to represent vacant seats, so
handle all of those cases.
  • Loading branch information
chrismytton committed May 18, 2016
1 parent 2ecac45 commit f2bcd8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper.rb
Expand Up @@ -26,7 +26,7 @@ def scrape_term(url)

page.xpath('//table//tr').drop(1).each do |tr|
tds = tr.xpath('td')
next if tds[1].text.tidy.downcase == 'vacant'
next if %w(vacant -vacant- ---).include?(tds[1].text.tidy.downcase)
data = {
seatid: tds[0].text.gsub(/[[:space:]]/, ' ').strip,
id: tds[3].xpath('.//img/@src').text.split('/').last.split('.').first,
Expand Down

0 comments on commit f2bcd8a

Please sign in to comment.