GithubHelp home page GithubHelp logo

instacrawler's Introduction

instacrawler

GET READY

Installation

$ pip install -r requirements.txt
$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
$ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
$ sudo apt-get update
$ sudo apt-get install google-chrome-stable
$ google-chrome --version

Chrome의 version을 확인하여 driver 다운로드 Chromedriver 해당 버전에 맞는 driver 설치를 누르면, OS 별로 파일 다운로드 창이 나오는데 여기서 해당 OS를 '마우스 우클릭 - 링크 주소 복사'하여,

$ wget https://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_linux64.zip
$ sudo apt-get install unzip
$ unzip chromedriver_linux64.zip
$ rm chromedriver_linux64.zip
$ ls

chromedriver가 생성된 것을 볼 수 있다.

Set up

Make log directory

$ cd instacrawler
$ mkdir Log

Make account.json

$ vim account.json
{
  "id":"my_id",
  "password":"my_password"
}

Requirements

Structure

instacrawler는 크게 CrawlerPreprocessing으로 나눠진다.

Crawler.py

Crawler는 미리 정의된 검색어를 instagram에서 검색하여 나오는 게시물들을 Crawling하여 하나의 태그에 대한 job이 완료된 시점의 timestamp를 filename으로 사용하여 pickle을 drop한다. 각 post에 대하여 Crawler가 pickle에 저장하는 데이터는 다음과 같다.

  • Posted date
  • Raw post content(with HTML tag forms)
  • User name
  • Likes
  • Image URL

Preprocessing.py

PreprocessingCrawler가 drop한 pickle을 열어서 Raw post content로부터 다음과 같은 데이터를 추출하고 데이터를 form에 맞게 Database에 commit한다.

  • Hashtags
  • Processed main content(without HTML tag form)

instacrawler's People

Contributors

emphasis10 avatar

Watchers

 avatar  avatar

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.