Giter Club home page Giter Club logo

pttcrawler's Introduction

PTTCrawler

This is a Crawler for PTT.

這是小弟無聊寫來練習的PTT推文爬蟲(不一定要用來爬推文XD)

輸入:想爬的版名,想從最新文章往回爬的頁數

輸出:把目標範圍內文章中的所有推文,每個推文Insert一次到MySQL

需要環境:

Python 2.7

  1. requests套件 http://docs.python-requests.org/en/latest/

  2. BeautifulSoup套件 http://www.crummy.com/software/BeautifulSoup/

  3. MySQLdb套件 https://pypi.python.org/pypi/MySQL-python

MySQL Server

使用方法:

  1. 修改Crawler中的MySQL登入訊息部分

  2. 使用Main,給參數(頁數,版名)

  3. 執行.py,會把你指定的版,從最新往回數你輸入的頁數,其中所有文章的推文都insrt到你的MySQL

  4. 會在MySQL Insert(每筆推文): 文章名稱,網址,推文者,推文種類,時間(年月日)

然後你的MySQL裡面就會有一堆raw data啦~想怎麼玩這些資料就怎麼玩A_A

如果有想要的功能或有bug歡迎留言~

pttcrawler's People

Contributors

gigayaya avatar

Watchers

 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.