Skip to content

Commit

Permalink
Find rows deeper in the table
Browse files Browse the repository at this point in the history
Something in the Wikimedia table markup must have changed, as these are now
within a 'tbody' tag, rather than at the top level.
  • Loading branch information
tmtmtmtm committed Aug 13, 2018
1 parent df5496e commit c1b1ed9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def scrape_list(term, url)
noko = noko_for(url)

current_parish = ''
noko.xpath('//h2[contains(span,"Constituencies and MPs")]/following-sibling::table[1]/tr[td]').each do |tr|
noko.xpath('//h2[contains(span,"Constituencies and MPs")]/following-sibling::table[1]//tr[td]').each do |tr|
tds = tr.css('td')

unless (parish = tds[0].css('a').text).empty?
Expand Down

0 comments on commit c1b1ed9

Please sign in to comment.