Giter Club home page Giter Club logo

crawler's Introduction

Requirements

java 8 has to be installed. That's all.

How To Install

0 If you don't want to compile from source, skip to next section. 1 If you want to compile from the source, you need maven to install the packages and prepare the bundle. 2 You can use google to install maven. 3 Once maven is installed, cd in to the home directory of where pom.xml is located and execute below commad:

	 mvn clean compile assembly:single

4 You should see a newly created directory (aptly) named as target. Continue to next section.

How to Run

0 If you have followed previous section, you can cd in to the newly created target directory. Or you can extract the attached zip file and go in to the directory where Crawler-0.1.0-jar-with-dependencies.jar is located. 1 Execute below command to run the code:

	 java -jar Crawler-0.1.0-jar-with-dependencies.jar

2 If you don't want to compile from source, I have already attached the above jar file and you can execute the above command from where the jar is located. 3 The above command will keep printing some relevant meta data until all the crawling is over. 4 The huge json dump will happen after all the urls have been crawled.

Design considerations

  • I have used jsoup to parse html and manipulate node attributes.
  • I have used google's gson for pretty printing and parsing the data in json format.
  • The code is very flexible and can accommodate many changes with very little change.
  • The unit test cases do not make a lot of sense to have one for each method as the requirements are very specific.
  • Some test cases have been added in Test.java

How to run test cases.

  • You can run tests using the command from the same directory as:

    java -cp Crawler-0.1.0-jar-with-dependencies.jar Test

  • You can add more test cases in Test.java (You have to use maven to rebuild the bundle)

crawler's People

Contributors

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