Skip to content

odoku/Scrapbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scrapbook

CircleCI

Scrapbook is simple scraping library.

from scrapbook import Element, Content
import requests


class Twitter(Content):
    username = Element(
        xpath='//*[@id="page-container"]/div[2]/div/div'
              '/div[1]/div/div/div/div[1]/h2/a/span/b/text()',
    )
    screen_name = Element(
        xpath='//*[@id="page-container"]/div[2]/div/div/'
              'div[1]/div/div/div/div[1]/h1/a',
    )


response = requests.get('https://twitter.com/odoku')
data = Twitter().parse(response.text)

print(data)

Requirements

  • Python 2.7 or Python 3.3+

Installation

pip install scrapbook

Document

https://scrapbook.readthedocs.org

About

Simple scraping library for python.

Resources

License

Stars

Watchers

Forks

Packages

No packages published