Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mafrahim/reddit

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Scrapy Example

Scraping http://www.reddit.com for posts and images using Scrapy http://scrapy.org

First presented at the Houston Python Web Development Meetup group. http://www.meetup.com/python-web-houston/events/219729234/

Use this code now

# Create a virtual environment
# mkvirtualenvwrapper must be installed
# not required, but nice to have
mkvirtualenv reddit

git clone https://github.com/eloyz/reddit.git

cd reddit
scrapy crawl pic

Creating your own project

# Create virtual environment
# mkvirtualenvwrapper must be installed
# not required, but nice to have
mkvirtualenv reddit

# Install python packages
pip install scrapy service_identity ipython pillow

Start a scrapy project

scrapy startproject reddit

At this point your reddit directory is created.

Generating a spider

Go into the directory, give it a name, and specify it's domain.

cd reddit
scrapy genspider pic www.reddit.com

Now's a good time to initialize your git repo (e.g. repository). Not required.

git init  # inside of the parent reddit directory

You can use this code as an example to help you get started as well as Scrapy's great documentation. http://doc.scrapy.org/en/0.24/

About

Scrapy (Python Framework) Example using reddit.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.