Code Monkey home page Code Monkey logo

web_crawling's Introduction

Download Travel-related data from Korean websites

This is a Python script that downloads data related to travel in Taiwan. The script scrapes text data from various Korean websites, including:

Prerequisite

This script uses Python3. Before running this script, please make sure you have the following libraries installed:

  • requests
  • beautifulsoup4
  • PyPDF4
  • pdfminer
  • pdfplumber

If you have not installed these libraries, please install them with the following command:

!pip install requests beautifulsoup4 PyPDF4 pdfminer pdfplumber

How to use

  1. Clone or download the repository to your computer.
  2. Open main.py with any Python IDE.
  3. Run the script.
  4. Magazine PDF will be downloaded in the pdf directory.
  5. Magazine txt will be downloaded in two versions.
    1. txt_pages: Separated by pages(ex: v01-p1.txt)
    2. txt_volumes: Separated by volumes(ex: v01.txt)

Description

Note

  • Currently, there are 20 pages in Professional travel(프로대만족) and 8 pages in Taiwan's attractions(대만 명소) . If there're new articles in those pages, adjust the numbers in get_pro_page and get_place_page functions in taiwanTour.py .
  • Currently, there are 47 volumes of magazines. If there's new article, adjust the number of getMagazine function in main.py .
  • The usefulness of each magazine page depends on the following conditions:
    • If the number of characters exceeds a certain number, it will be judged as useful content. (Based on experiment, using 140 characters as a criterion provides better quality)
    • If the content includes key words such as '도표', "통계", "Content", "fax", the page will be skipped. (To avoid extracting tables, contacts, and content tables)
  • V16 magazine is in image format, so the program failed exracting content.

web_crawling's People

Contributors

roylee1224 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.