Giter Site home page Giter Site logo

python-web-crawler's Introduction

A programming excercise. A web crawler written in python.

Usage
python --version
Python 2.7.2+

python crawl.py http://www.keza.net 2 JavaScript
crawl.py [url] [depth] [search term]

TODO
the complex part.
figure out how to do tests first.
error handling.

Thoughts
It took 2 hours.
I have never seen python before.
python seems to make sense.
finding the correct regex method was tricky.
casting numbers to strings was annoying.

Problem statement:
Language: Python 
Official site: http://python.org/ 
Beginer's guide: http://wiki.python.org/moin/BeginnersGuide 
Tutorial: http://docs.python.org/tutorial/ 
 
App Category: Networking 
DB: None 
Simple part: 
Create a web crawler app in python which, given a url seed, can crawl 
through all links on the page and scan deep for a given level of 
depth. While crawling the app should be able to return the url page 
containing a specific search text. 
Input: 
1 - Url seed e.g. www.hackernews.com 
2 - Depth e.g. 5 (this means go into links on a page till 5 levels) 
3 - search text e.g. "python" 
Output: 
the list of url that contains the specified text 
The Simple part is mandatory to be completed. 
If you finish the simple part and are eager to take up something 
challenging, then here's a little complex angle to the problem: 
Complex part: 
Write rules around the app for searching. 
Rule 1: The return Url should contain a specific substring 
Rule 2: Highlight in output if the url is amongst a long list of 
blacklisted urls (about 10000 blacklisted urls) 
Rule 3: Search for multiple search strings and rank Urls as per the 
number of different search strings found and occurances of each search 
string in the page 
Rule 4: Rank as per level of the Url w.r.t. seed url 

python-web-crawler's People

Contributors

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