Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python
branch: master

Merge pull request #4 from devinberg/patch-1

Minor change to get working with BeautifulSoup4
latest commit bb349db1be
@wrttnwrd authored

README

cmcrawler.py

By Ian Lurie
Using the following amazing libraries, without which I'd be hopelessly out of luck:
httplib
BeautifulSoup
urlparse


12.13.10 revision:
BIG changes to the crawler:

1. Reduced crawl time by switching to httplib instead of urllib.
2. Now tests for 404 and other status codes.
3. Now grabs header to determine content type.
4. Command-line switch to stick with internal or check external URLs.

cmcrawler.py is meant to be a light, fast, Python-driven crawler.

To use the crawler, go to your command line (ACK, I KNOW!) and type 

python cmcrawler.py http://www.siteurl.com [crawl external]

Replace [crawl external] with a 0 if you just want to crawl internal URLs, or 1 if you want to crawl external, too.

It'll then cheerfully go off and start crawling your site, outputting the result as it goes. It doesn't save the output anywhere! You can cut-and-paste the result if you're really insane, or do the easier:

python cmcrawler.py http://www.siteurl.com [crawl external] >> filename.txt

That'll write the results to a text file, instead.

If none of this makes sense to you, you probably shouldn't be messing with this. I'm not saying that to be mean. This is a crawler written by someone who knows juuuuust enough to be dangerous. As such, you should be very, very careful with it.

I would greatly appreciate any improvements/tweaks that folks make. Please check them back into GIT or send 'em to me. This is a community thing, I hope.



KNOWN ISSUES/TWEAKS NEEDED
See the GIThub page at https://github.com/wrttnwrd/cmcrawler/issues
Something went wrong with that request. Please try again.