> ## Content Index
> Fetch the complete content index at: https://darkwebinformer.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# TorCrawl: Crawl and Extract (Regular or Onion) Webpages Through TOR Network
- URL: https://darkwebinformer.com/torcrawl-crawl-and-extract-regular-or-onion-webpages-through-tor-network/
- Published: 2024-10-27T15:07:49.000Z
- Updated: 2025-09-04T22:25:47.000Z
- Author: Dark Web Informer
- Tags: OSINT, Tools

GitHub: <https://github.com/MikeMeliz/TorCrawl.py>  
Last Commit: October 27th, 2024

---

### TorCrawl.py is a Python script designed for anonymous web scraping via the Tor network.

[](https://github.com/MikeMeliz/TorCrawl.py#torcrawlpy-is-a-python-script-designed-for-anonymous-web-scraping-via-the-tor-network)

It combines ease of use with the robust privacy features of Tor, allowing for secure and untraceable data collection. Ideal for both novice and experienced programmers, this tool is essential for responsible data gathering in the digital age.

[](https://github.com/MikeMeliz/TorCrawl.py/releases) [](https://github.com/MikeMeliz/TorCrawl.py/commits/main) [](https://camo.githubusercontent.com/54b27f76c02b53dd826d8de999188bb2462c85ab338985fd2feed6a33e62a197/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f507974686f6e2d76332d677265656e2e7376673f7374796c653d706c6173746963266c6f676f3d707974686f6e266c6162656c3d507974686f6e) [](https://github.com/MikeMeliz/TorCrawl.py/blob/master/LICENSE)

### What makes it simple and easy to use?

[](https://github.com/MikeMeliz/TorCrawl.py#what-makes-it-simple-and-easy-to-use)

If you are a terminal maniac you know that things have to be simple and clear. Passing the output into other tools is necessary and accuracy is the key.

With a single argument, you can read an .onion webpage or a regular one, through TOR Network and by using pipes you can pass the output at any other tool you prefer.

$ torcrawl -u http://www.github.com/ | grep 'google-analytics'  
 <meta-name="google-analytics" content="UA-XXXXXX- "> 

If you want to crawl the links of a webpage use the `-c` and **BAM** you got on a file all the inside links. You can even use `-d` to crawl them and so on. You can also use the argument `-p` to wait some seconds before the next crawl.

$ torcrawl -v -u http://www.github.com/ -c -d 2 -p 2  
\# TOR is ready!  
\# URL: http://www.github.com/  
\# Your IP: XXX.XXX.XXX.XXX  
\# Crawler started from http://www.github.com/ with 2 depth crawl and 2 second(s) delay:  
\# Step 1 completed with: 11 results  
\# Step 2 completed with: 112 results  
\# File created on /path/to/project/links.txt

Tip

Crawling is not illegal, but violating copyright *is*. It’s always best to double check a website’s T&C before start crawling them. Some websites set up what’s called `robots.txt` to tell crawlers not to visit those pages.  
This crawler *will* allow you to go around this, but we always *recommend* respecting robots.txt.

---

## Installation

[](https://github.com/MikeMeliz/TorCrawl.py#installation)

### Easy Installation with pip:

[](https://github.com/MikeMeliz/TorCrawl.py#easy-installation-with-pip)

*Comming soon..*

### Manual Installation:

[](https://github.com/MikeMeliz/TorCrawl.py#manual-installation)

1. **Clone this repository**:  
`git clone https://github.com/MikeMeliz/TorCrawl.py.git`
2. **Install dependecies**:  
`pip install -r requirements.txt`
3. **Install and Start TOR Service**:
  1. **Debian/Ubuntu**:  
  `apt-get install tor  
  service tor start`
  2. **Windows**: Download [tor.exe](https://www.torproject.org/download/tor/), and:  
  `tor.exe --service install  
  tor.exe --service start`
  3. **MacOS**:  
  `brew install tor  
  brew services start tor`
  4. For different distros, visit:  
  [TOR Setup Documentation](https://www.torproject.org/docs/)

## Arguments

[](https://github.com/MikeMeliz/TorCrawl.py#arguments)

| **arg**      | **Long**               | **Description**                                                                |
| ------------ | ---------------------- | ------------------------------------------------------------------------------ |
| **General**: |                        |                                                                                |
| \-h          | \--help                | Help message                                                                   |
| \-v          | \--verbose             | Show more information about the progress                                       |
| \-u          | \--url \*.onion        | URL of Webpage to crawl or extract                                             |
| \-w          | \--without             | Without using TOR Network                                                      |
| \-f          | \--folder              | The directory which will contain the generated files                           |
| **Extract**: |                        |                                                                                |
| \-e          | \--extract             | Extract page's code to terminal or file (Default: Terminal)                    |
| \-i          | \--input filename      | Input file with URL(s) (seperated by line)                                     |
| \-o          | \--output \[filename\] | Output page(s) to file(s) (for one page)                                       |
| \-y          | \--yara                | Perform yara keyword search:h = search entire html object,t = search only text |
| **Crawl**:   |                        |                                                                                |
| \-c          | \--crawl               | Crawl website (Default output on website/links.txt)                            |
| \-d          | \--cdepth              | Set depth of crawler's travel (Default: 1)                                     |
| \-p          | \--pause               | Seconds of pause between requests (Default: 0)                                 |
| \-l          | \--log                 | Log file with visited URLs and their response code                             |

## Usage & Examples

[](https://github.com/MikeMeliz/TorCrawl.py#usage--examples)

### As Extractor:

[](https://github.com/MikeMeliz/TorCrawl.py#as-extractor)

To just extract a single webpage to terminal:

$ python torcrawl.py -u http://www.github.com  
  
...  
</html>

Extract into a file (github.htm) without the use of TOR:

$ python torcrawl.py -w -u http://www.github.com -o github.htm  
\## File created on /script/path/github.htm

Extract to terminal and find only the line with google-analytics:

$ python torcrawl.py -u http://www.github.com | grep 'google-analytics'  
 <meta name="google-analytics" content="UA-\*\*\*\*\*\*\*-\*">

Extract to file and find only the line with google-analytics using yara:

$ python torcrawl.py -v -w -u https://github.com -e -y 0  
...

***Note:*** update res/keyword.yar to search for other keywords. Use `-y 0` for raw html searching and `-y 1` for text search only.

Extract a set of webpages (imported from file) to terminal:

$ python torcrawl.py -i links.txt  
...

### As Crawler:

[](https://github.com/MikeMeliz/TorCrawl.py#as-crawler)

Crawl the links of the webpage without the use of TOR, also show verbose output (really helpfull):

$ python torcrawl.py -v -w -u http://www.github.com/ -c  
\## URL: http://www.github.com/  
\## Your IP: \*.\*.\*.\*  
\## Crawler Started from http://www.github.com/ with step 1 and wait 0  
\## Step 1 completed with: 11 results  
\## File created on /script/path/links.txt

Crawl the webpage with depth 2 (2 clicks) and 5 seconds waiting before crawl the next page:

$ python torcrawl.py -v -u http://www.github.com/ -c -d 2 -p 5  
\## TOR is ready!  
\## URL: http://www.github.com/  
\## Your IP: \*.\*.\*.\*  
\## Crawler Started from http://www.github.com with step 2 and wait 5  
\## Step 1 completed with: 11 results  
\## Step 2 completed with: 112 results  
\## File created on /script/path/links.txt

### As Both:

[](https://github.com/MikeMeliz/TorCrawl.py#as-both)

You can crawl a page and also extract the webpages into a folder with a single command:

$ python torcrawl.py -v -u http://www.github.com/ -c -d 2 -p 5 -e  
\## TOR is ready!  
\## URL: http://www.github.com/  
\## Your IP: \*.\*.\*.\*  
\## Crawler Started from http://www.github.com with step 1 and wait 5  
\## Step 1 completed with: 11 results  
\## File created on /script/path/FolderName/index.htm  
\## File created on /script/path/FolderName/projects.html  
\## ...

**Note:** *The default (and only for now) file for crawler's links is the `links.txt` document. Also, to extract right after the crawl you have to give `-e` argument*

Following the same logic; you can parse all these pages to grep (for example) and search for specific text:

$ python torcrawl.py -u http://www.github.com/ -c -e | grep '</html>'  
</html>  
</html>  
...

### As Both + Keyword Search:

[](https://github.com/MikeMeliz/TorCrawl.py#as-both--keyword-search)

You can crawl a page, perform a keyword search and extract the webpages that match the findings into a folder with a single command:

$ python torcrawl.py -v -u http://www.github.com/ -c -d 2 -p 5 -e -y h  
\## TOR is ready!  
\## URL: http://www.github.com/  
\## Your IP: \*.\*.\*.\*  
\## Crawler Started from http://www.github.com with step 1 and wait 5  
\## Step 1 completed with: 11 results  
\## File created on /script/path/FolderName/index.htm  
\## File created on /script/path/FolderName/projects.html  
\## ...

**Note:** *Update res/keyword.yar to search for other keywords. Use `-y h` for raw html searching and `-y t` for text search only.*

## Demo

[](https://github.com/MikeMeliz/TorCrawl.py#demo)

![](https://storage.ghost.io/c/6b/16/6b16ac9c-cd67-432f-b0f3-bbec941084ff/content/images/2024/10/8732872532.gif)

## Contribution

[](https://github.com/MikeMeliz/TorCrawl.py#contribution)

Feel free to contribute on this project! Just fork it, make any change on your fork and add a pull request on current branch!

[](https://github.com/MikeMeliz/TorCrawl.py/graphs/contributors)

![:shipit:](https://github.githubassets.com/images/icons/emoji/shipit.png ":shipit:")

 Any advice, help or questions will be appreciated! 

![:shipit:](https://github.githubassets.com/images/icons/emoji/shipit.png ":shipit:")

## License

[](https://github.com/MikeMeliz/TorCrawl.py#license)

“GPL” stands for “General Public License”. Using the GNU GPL will require that all the released improved versions be free software ([More info](https://www.gnu.org/licenses/gpl-faq.html)).

## Changelog

[](https://github.com/MikeMeliz/TorCrawl.py#changelog)v1.31:  
 \* Fixed Input Link NoneType Error  
 \* Fixed name mismatch   
v1.3:  
 \* Make yara search optional  
v1.21:  
 \* Fixed typos of delay (-d)  
 \* Fixed TyperError and IndexError   
v1.2:  
 \* Migrated to Python3  
 \* Option to generate log file (-l)  
 \* PEP8 Fixes  
 \* Fix double folder generation (http:// domain.com)