Skip to main content

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.

  1. Install uv:

    Follow the instructions for your system at: https://docs.astral.sh/uv/getting-started/installation/

  2. Install Playwright and Chromium:

    uvx playwright install chromium
    
  3. 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 add https://.

  4. Interact with the browser:

    The script will open a browser window. You can interact with the page as you normally would.

  5. Close the browser:

    After you are done browsing, press Enter in the terminal to close the browser and save the domains.

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

domain_collector-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

domain_collector-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file domain_collector-0.1.1.tar.gz.

File metadata

  • Download URL: domain_collector-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.18

File hashes

Hashes for domain_collector-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7d26f73bc336723cf612e27e90e0e37f5ab92831c422d2885b66a7112165a73e
MD5 a24a3421a55b133b521c4ea51011ede4
BLAKE2b-256 7b26c3ffd1f0c2cb5ca948ee1ad2b3ff389d0abbd5d314d02eee666a42c1bc92

See more details on using hashes here.

File details

Details for the file domain_collector-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for domain_collector-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73a7d74710d8f40b27bef077736c891548a5df76eb7de6fe4c93d692a1290e3c
MD5 7339724a35cc05ae02c4db3e9b853393
BLAKE2b-256 f7e20230424b3a3b8aab0f0dc76ad33e24bfabfd8437ea30a6597b707e8987db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page