This is a scraper that runs on Morph. To get started see the documentation

Contributors jacksonj04

Last run failed with status code 1.

Console output of last run

Injecting configuration and compiling...  -----> Python app detected  ! The latest version of Python 2 is python-2.7.14 (you are using python-2.7.9, which is unsupported).  ! We recommend upgrading by specifying the latest version (python-2.7.14).  Learn More: https://devcenter.heroku.com/articles/python-runtimes -----> Installing python-2.7.9 -----> Installing pip -----> Installing requirements with pip  Obtaining scraperwiki from git+http://github.com/openaustralia/scraperwiki-python.git@morph_defaults#egg=scraperwiki (from -r /tmp/build/requirements.txt (line 6))  Cloning http://github.com/openaustralia/scraperwiki-python.git (to revision morph_defaults) to /app/.heroku/src/scraperwiki  Switched to a new branch 'morph_defaults'  Branch morph_defaults set up to track remote branch morph_defaults from origin.  Collecting lxml==3.4.4 (from -r /tmp/build/requirements.txt (line 8))  Downloading https://files.pythonhosted.org/packages/63/c7/4f2a2a4ad6c6fa99b14be6b3c1cece9142e2d915aa7c43c908677afc8fa4/lxml-3.4.4.tar.gz (3.5MB)  Collecting cssselect==0.9.1 (from -r /tmp/build/requirements.txt (line 9))  Downloading https://files.pythonhosted.org/packages/aa/e5/9ee1460d485b94a6d55732eb7ad5b6c084caf73dd6f9cb0bb7d2a78fafe8/cssselect-0.9.1.tar.gz  Collecting dumptruck>=0.1.2 (from scraperwiki->-r /tmp/build/requirements.txt (line 6))  Downloading https://files.pythonhosted.org/packages/15/27/3330a343de80d6849545b6c7723f8c9a08b4b104de964ac366e7e6b318df/dumptruck-0.1.6.tar.gz  Collecting requests (from scraperwiki->-r /tmp/build/requirements.txt (line 6))  Downloading https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8/requests-2.20.0-py2.py3-none-any.whl (60kB)  Collecting idna<2.8,>=2.5 (from requests->scraperwiki->-r /tmp/build/requirements.txt (line 6))  Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)  Collecting certifi>=2017.4.17 (from requests->scraperwiki->-r /tmp/build/requirements.txt (line 6))  Downloading https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl (146kB)  Collecting urllib3<1.25,>=1.21.1 (from requests->scraperwiki->-r /tmp/build/requirements.txt (line 6))  Downloading https://files.pythonhosted.org/packages/8c/4b/5cbc4cb46095f369117dcb751821e1bef9dd86a07c968d8757e9204c324c/urllib3-1.24-py2.py3-none-any.whl (117kB)  Collecting chardet<3.1.0,>=3.0.2 (from requests->scraperwiki->-r /tmp/build/requirements.txt (line 6))  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)  Installing collected packages: dumptruck, idna, certifi, urllib3, chardet, requests, scraperwiki, lxml, cssselect  Running setup.py install for dumptruck: started  Running setup.py install for dumptruck: finished with status 'done'  Running setup.py develop for scraperwiki  Running setup.py install for lxml: started  Running setup.py install for lxml: still running...  Running setup.py install for lxml: finished with status 'done'  Running setup.py install for cssselect: started  Running setup.py install for cssselect: finished with status 'done'  Successfully installed certifi-2018.10.15 chardet-3.0.4 cssselect-0.9.1 dumptruck-0.1.6 idna-2.7 lxml-3.4.4 requests-2.20.0 scraperwiki urllib3-1.24   -----> Discovering process types  Procfile declares types -> scraper Injecting scraper and running... (i) Scraping from http://www.parliament.go.ke/the-national-assembly/members?start=0 Traceback (most recent call last): File "scraper.py", line 427, in <module> html = scraperwiki.scrape(scrapeUrl) File "/app/.heroku/src/scraperwiki/scraperwiki/utils.py", line 31, in scrape f = urllib2.urlopen(req) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 437, in open response = meth(req, response) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 550, in http_response 'http', request, response, code, msg, hdrs) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 475, in error return self._call_chain(*args) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 409, in _call_chain result = func(*args) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 558, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 404: Not Found

Data

Downloaded 1162 times by everypolitician jacksonj04

To download data sign in with GitHub

Download table (as CSV) Download SQLite database (102 KB) Use the API

rows 10 / 349

name url honorific_string honorific_id id district party district_id constituency county party_id role
MP (Dr.) Keynan, Wehliye Adan, CBS
Hon.
Q2746176
4011-hon-keynan-wehliye-adan
JP
Q47463412
Eldas
Wajir
Q27963537
Yusuf Hassan Abdi
Hon.
Q2746176
3921-hon-abdi-yusuf-hassan
JP
Q6359828
Kamukunji
Nairobi
Q27963537
Bashir Sheikh Abdullah
Hon.
Q2746176
3922-hon-abdullah-bashir-sheikh
JP
Q47463414
Mandera North
Mandera
Q27963537
Paul Odalo Mak'Ojuando Abuor
Hon.
Q2746176
3923-hon-abuor-paul-odalo-mak’ojuando
ODM
Q7365633
Rongo
Migori
Q1640905
Beatrice Kahai Adagala
Hon.
Q2746176
3924-hon-adagala-beatrice-kahai
ANC
Q1313202
Vihiga
Vihiga
Q47489380
Q47484213
Safia Sheikh Adan
Hon.
Q2746176
3925-hon-adan-safia-sheikh
JP
Q1323683
Marsabit
Marsabit
Q27963537
Q47484213
Shakeel Ahmed Shabbir Ahmed
Hon.
Q2746176
3926-hon-ahmed-shakeel-ahmed-shabbir
IND
Q6417349
Kisumu East
Kisumu
Q327591
Miruka Ondieki Alfah
Hon.
Q2746176
3927-hon-alfah-miruka-ondieki
KNC
Q47463485
Bomachoge Chache
Kisii
Q6392670
Adan Haji Ali
Hon.
Q2746176
3928-hon-ali-adan-haji
JP
Q47462269
Mandera South
Mandera
Q27963537
Amin Deddy Mohamed Ali
Hon.
Q2746176
3929-hon-ali-amin-deddy-mohamed
JP
Q6473833
Laikipia East
Laikipia
Q27963537

Statistics

Average successful run time: less than a minute

Total run time: 2 days

Total cpu time used: 4 minutes

Total disk space used: 219 KB

History

  • Auto ran revision 934c66fd and failed .
    nothing changed in the database
  • Auto ran revision 934c66fd and failed .
    nothing changed in the database
    1 page scraped
  • Auto ran revision 934c66fd and failed .
    nothing changed in the database
    1 page scraped
  • Auto ran revision 934c66fd and failed .
    nothing changed in the database
    1 page scraped
  • Auto ran revision 934c66fd and failed .
    nothing changed in the database
    1 page scraped
  • ...
  • Created on morph.io

Show complete history

Scraper code

Python

kenya-parliament-members / scraper.py