Giter Club home page Giter Club logo

selenium_webcrawler_on_peronet's Introduction

Crawling PDF-files in a government website

Purpose of the script

Downloading all(not exactly all much most of them) pdf files attached to the website.

How

used sellenium and chromewebdriver. It was not really difficult to understand how they work. But debugging was indeed very much irritating.

Internal structure

  1. the big for loop : counts of the data you want to download from the certain page.

  2. There was frame(an html tag used for containing another html page inside one). Had to understand the function of switch_to function.

  3. The next function(didn't make them into actual function just yet, but I mean the actual work that was needed to be done) getting the next element(file) in the page was the most important function. Getting next <tr>, and next <page_number> and, when the page_number ended in multiple of 10, there next <arrow_button> was needed. and the source code <arrow_button> changed from time to time(first 10 page, and the ones afterwards were different).

Problems

  1. 예외처리가 가장 어려웠다. 특히 파일에 따라서 page가 일부 다운되어버리는 현상이 있었는데, 이런 예외를 일으키는 파일의 table상의 위치에 따라서 각기 다른 예외처리가 필요했다.(페이지의 마지막인지 아닌지에 따라서...)

Reference

사이트 : petronet.co - 아이디 비번은 다른 사람 것

chrome webdriver77 download hear -> but brew cask install chromedriver is much better.

selenium_webcrawler_on_peronet's People

Contributors

eomiso avatar

Watchers

James Cloos 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.