Coder Social home page Coder Social logo

sexinsex-crawler's Introduction

sexinsex-crawler

A simple python crawler for sexinsex board

Also works for most Discuz! forums. Just change the start url in config file.

Usage

First change the settings in config.py

To download the initial page:

python3 initializer.py

To extract all thread ids in the initial page (extracted thread ids are stored in a list and dumped to a pickle file):

python3 thread_tids_extractor.py

To download all threads from the list you just extracted from the initial page (all html files are saved to the html folder):

python3 selenium_html_downloader.py

To extract the main contents of all html files in the html folder (saved to the text folder):

python3 page_content_extractor.py

To extract attachment ids in all html files in the html folder (extracted attachment ids are stored in a list and dumped to a pickle file):

python3 page_aids_extractor.py

To download all attachments from the list you just extracted from files in the html folder (attachments are saved to your Downloads folder):

python3 selenium_attachment_downloader.py

Note that you must have selenium and chromedriver installed to run programs that start with "selenium". Most pages and attachments are only available after you login, so you may need to fill in your login credentials in config.py to download them.

Known bugs

There are a lot of empty .crdownload files generated in your download folder if you run selenium_attachment_downloader.py, but all files actually finished downloading and it's safe to remove these empty .crdownload files. You will not miss any attachment.

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.