Skip to content

idesouza/ghana-mps

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a scraper that runs on Morph.

To get started see the documentation

This is a template for a Python scraper on Morph (https://morph.io)

including some code snippets below that you should find helpful

import scraperwiki

import lxml.html

# Read in a page

html = scraperwiki.scrape("http://foo.com")

# Find something on the page using css selectors

root = lxml.html.fromstring(html)

root.cssselect("div[align='left']")

# Write out to the sqlite database using scraperwiki library

scraperwiki.sqlite.save(unique_keys=['name'], data={"name": "susan", "occupation": "software developer"})

# An arbitrary query against the database

scraperwiki.sql.select("* from data where 'name'='peter'")

You don't have to do things with the ScraperWiki and lxml libraries. You can use whatever libraries are installed

is that your final data is written to an Sqlite database called data.sqlite in the current working directory which

has at least a table called data.

About

Members of Parliament in Ghana

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%