Skip to content

Commit

Permalink
Only get current term
Browse files Browse the repository at this point in the history
  • Loading branch information
tmtmtmtm committed May 22, 2016
1 parent 3a8b48b commit d86cd03
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions scraper.rb
Expand Up @@ -3,7 +3,17 @@

require 'wikidata/fetcher'

names = EveryPolitician::Wikidata.morph_wikinames(source: 'tmtmtmtm/france-national-assembly-wikipedia', column: 'wikiname')
names.shuffle.each_slice(50) do |sliced|
EveryPolitician::Wikidata.scrape_wikidata(names: { fr: sliced })
end
# names = EveryPolitician::Wikidata.morph_wikinames(source: 'tmtmtmtm/france-national-assembly-wikipedia', column: 'wikiname')
# names.shuffle.each_slice(50) do |sliced|
# EveryPolitician::Wikidata.scrape_wikidata(names: { fr: sliced })
# end
#

names = EveryPolitician::Wikidata.wikipedia_xpath(
url: 'https://fr.wikipedia.org/wiki/Liste_des_députés_de_la_XIVe_législature_de_la_Cinquième_République',
after: '//span[@id="Liste_des_d.C3.A9put.C3.A9s"]',
before: '//span[@id="Notes_et_r.C3.A9f.C3.A9rences"]',
xpath: '//table//tr//td[1]//a[not(@class="new")]/@title',
)

EveryPolitician::Wikidata.scrape_wikidata(names: { fr: names })

0 comments on commit d86cd03

Please sign in to comment.