GithubHelp home page GithubHelp logo

web-crawler-python's Introduction

Web Crawler in Python

Course Project for COMP 1405Z Fall 2021.

Description

This project’s goal is to determine the top ten pages found during a crawl related to the user’s search query. The focus was to decrease time complexity and therefore increase the efficiency of the project. More on this matter can be found in the report included in the project. The project is divided into three parts: crawler, searchdata, and search.

Crawler

Main function: extract, manipulate, and save data from HTML strings.

The crawler accepts a seed URL to parse. It will then parse the URLs embedded in the seed URL (determined by <a> tags) and continue to do so for each page it finds until the program has parsed every page. For each page, the crawler will extract the inner HTML content of the <p> tags to determine TF, IDF, and TF-IDF values for words on the page. The crawler is also in charge of extracting outgoing and incoming links to determine the page’s page rank. The crawler will save all this information in respective files for later use.

Search Data

Main function: extract the correct data from files created in the crawler.

The searchdata file simply retrieves any information required while running the search.

Search

Main function: accept a search query and outputs the top ten pages

The search file will determine the TF-IDF of the inputted query to calculate the cosine similarity of all pages found during the crawl. If the user chooses to “boost” these values, the cosine similarity score will be multiplied by the page’s page rank for the final score. The program will take those values and sort them using an efficient sorting algorithm to output the ten pages with the highest scores.

Running the Project

The included python files are modules. To watch them in action, refer to the test files. Make sure that the test files are in the same directory as the project files. Note that this project’s focus was not HTML/web development and is therefore designed to run on specific websites such as http://people.scs.carleton.ca/~davidmckenney/tinyfruits/N-0.html

Special Thanks

Testing resources provided by Dave McKenney, Instructor at Carleton University.

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.