Giter Club home page Giter Club logo

webscrapper's Introduction

WebScrapper


Basic Workflow: The user is asked for a website to use as a starting point for the crawl. Then the user specifies a word or a sentence that is to be searched in the given website. The user will also be asked for the nuber of pages to search for.

Once everything is there the program makes the connection with the website and the search is initiated.

Working: I have used a java library called JSoup to deal with all the web connection and extration stuff. The things on my side was to store the extracted links, track the links and determine if they have been visited before(to avoid loops), keep the track of number of pages that are visited. I have used sets to deal with the repetation problem and have a queue(implementation of linkedlist) to deal with storage of the extracted links.

Once the crawl is initiated, the body of the html document is extarcted by the use of method calls from the Jsoup library. Then the given word/sentence is search against the content of the extracted body, and returns boolean result as per the condition.

Note: I used intellij IDE for this project and when I ran it in embeded terminal of the IDE, I had to use an extra space character at the end of the url when asked for the website as its default behavior is set to open the url in web brower when we press "enter". Also, if you will be using a system terminal, there won't be need of any need of extra space character for the senario.

During the course of development I used several resourses:
http://www.netinstructions.com/how-to-make-a-simple-web-crawler-in-java/
https://www.mkyong.com/java/jsoup-basic-web-crawler-example/
https://jsoup.org/

Execution:
Execution Image

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.