GithubHelp home page GithubHelp logo

webcrawler's Introduction

Python Web Crawler Project

This Python project aims to find all valid webpages on a website given a starting url.

Said another way, we'd like all webpages that can be found on a website if we start on the home page. This program will find all of those urls, and output them to a file.

Code Logic

  1. Create a hashmap for all visited urls.

  2. Create a queue for urls that we need to check.

  3. Create a list of valid urls (to output later).

  4. Receive input (of the first url).

  5. Add that url to our check queue.

  6. While our check queue is not empty... 4. If the url was not visited already... 5. Mark it as visited (by adding it to our hashmap). 6. Download the html of the webpage. 7. Parse the HTML for all urls (into a list). 8. For each url in the list... 9. Check that the url is valid. (Not from another site, or an invalid subdomain). 10. If that url is valid then... 11. Add it to the valid url list. 12. Add it to the queue (if the url wasn't visited already).

  7. Sort the list of valid urls.

  8. Write that list to a file.

Copyright

The copyright belongs to www.srcmake.com 2018. Feel free to use or modify the code. This is just a fun little project.

webcrawler's People

Watchers

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