Code Monkey home page Code Monkey logo

property_crawler's Introduction

I. Install with Vagrant

  1. Install Vagrant

  2. Clone our repository

	https://github.com/bagiks/property_crawler
	cd property_crawler
  1. Install Berkshelf
  • Download ChefSDK
    https://downloads.chef.io/chef-dk/
  • Install berkshelf plugin
    vagrant plugin install vagrant-berkshelf
  • If there is no cookbooks/dev director insite the folder.

        mkdir -p cookbooks/dev
        cd cookbooks
        berks cookbook dev
    

    Add cookbook to cookbooks/Dev/Berksfile

       source "https://supermarket.chef.io"
    
       metadata
       cookbook 'poise-python', '~> 1.4.0'
       cookbook 'vim', '~> 2.0.1'
       cookbook 'mongodb', '~> 0.16.2'
       cookbook 'apt', '~> 4.0.0'
    
    
  1. Run vagrant
    vagrant up
  1. ssh to virtual machine
    vagrant ssh
  1. go to project folder at cd /vagrant_data.

Scrapy / python / mongodb are installed. Enjoy !

  1. Run demo on commandline
    scrapy crawl Flats-Property-Crawler
  1. Run with Pycharm
  • Install Vagrant plugin in Pycharm

  • "Vagrant up " in Tools -> Vagrant -> ...

  • Change Python interpreter

  • Go to property_crawler/spiders/9flats.py, uncomment this block

process = CrawlerProcess({
     'USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'
 })

process.crawl(FlatsPropertyCrawlSpider)

process.start()
  • Run 9flats.py

II. Install without Vagrant

  1. Install Anaconda, python 2.7

  2. Creat a new enviroment scraping with scrapy package

	conda create --name scraping Scrapy
  1. Activate / deactivate the enviroment
	source actiavate scraping
	source deactivate
  1. Clone property_crawler repository
	https://github.com/bagiks/property_crawler
	cd property_crawler
  1. Install python package
	pip install -r requirements.txt
  1. Install mongodb and start service
  2. Create db bagiks, collection property
  3. Run ``` scrapy crawl Flats-Property-Crawler``

  1. Dev with Pycharm
process = CrawlerProcess({
     'USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'
 })

process.crawl(FlatsPropertyCrawlSpider)

process.start()
  • Run 9flats.py

property_crawler's People

Contributors

duyvk avatar nhtienquang avatar kduy avatar

Watchers

James Cloos avatar kju avatar  avatar  avatar  avatar

Forkers

mtcld

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.