Collect domains with ease
Project description
Domain Collector
This script allows you to extract unique domains visited when browsing a given URL in a browser. It uses Playwright to open a browser, allows user interaction, and then saves the visited domains to a file.
Features
- Opens a URL in a browser.
- Allows user interaction with the browser.
- Extracts all unique domains visited during the browsing session.
- Saves the list of unique domains to a text file.
Usage
To use the script, you need to have uv installed.
-
Install uv:
Follow the instructions for your system at: https://docs.astral.sh/uv/getting-started/installation/
-
Install Playwright and Chromium:
uvx playwright install chromium
-
Run the script:
uvx domain-collector <URL>
Replace
<URL>with the URL you want to open in the browser. For example:uvx domain-collector https://ya.ru
You can also provide a URL without the scheme (e.g.,
ya.ru), and the script will automatically addhttps://. -
Interact with the browser:
The script will open a browser window. You can interact with the page as you normally would.
-
Close the browser:
After you are done browsing, press
Enterin the terminal to close the browser and save the domains. -
Output:
The script will save the unique domains to a file named
<domain>_domains.txt(e.g.,ya_ru_domains.txt) in the same directory where you ran the script. If the file already exists, new domains will be added to the existing list, avoiding duplicates.
Example
uvx domain-collector https://www.wikipedia.org
This will open the Wikipedia homepage in a browser. After you interact with the page and close the browser, the script will save the visited domains to a file named wikipedia_org_domains.txt.
Cleanup
To remove all artifacts, you can use the following commands:
uvx playwright uninstall --all
uv cache clean # Use with caution, this will remove all uv cache
Dependencies
- Python 3.7+
- Playwright
- argparse
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file domain_collector-0.1.2.tar.gz.
File metadata
- Download URL: domain_collector-0.1.2.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c65a2e7f8c3c0e8a6e6db713d4f22534e61f8dd51a914a782912c1b999972353
|
|
| MD5 |
e895e9d9b33c1d3101dddc41d906322f
|
|
| BLAKE2b-256 |
9f0054db007ec6bffa4c36338ea40ff627e719d3aadbd5c470d6c3e83ef7c81c
|
File details
Details for the file domain_collector-0.1.2-py3-none-any.whl.
File metadata
- Download URL: domain_collector-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
779b7f0866f4a9cf39a9bbc6a5716b4096271c7ae8929aaf457871b2e910a4f5
|
|
| MD5 |
0b39cf136f08c39eaf52b98861d762dc
|
|
| BLAKE2b-256 |
d411cc8a3a02b27c429dbe59658ca1382ca1b761710b2533a7293c98795eed72
|