Skip to content

nothingness-dev/AutoShot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 AutoShot

AutoShot is a lightweight Python tool that validates a URL, opens it in Google Chrome (headless or visible), takes a screenshot, and saves it locally. Built with Selenium and simple regex, it’s perfect for quick web snapshots and learning browser automation.


✨ Features

✅ Validates URLs with regex

👀 Runs Chrome in headless (background) or visible mode

💾 Saves screenshots in the images/ folder with your chosen filename

🧩 Clean, modular code structure for easy maintenance


📂 Project Structure

auto-shot/ ├── automation.py # Browser automation and screenshot logic ├── url_validation.py # URL validation using regex ├── url.py # User input for URLs ├── run.py # Main runner script ├── requirements.txt # Python dependencies ├── images/ # Screenshots saved here (create if missing) └── README.md # This file


🛠 Requirements

Python 3.8+

Google Chrome installed


⚙️ Installation

  1. Clone or download this repo

  2. Install dependencies:

pip install -r requirements.txt

Example requirements.txt:

selenium==4.34.4 webdriver-manager


🚦 Usage

Run the script from the project root:

python run.py

Follow the prompts:

🌐 Enter the URL (e.g., https://www.example.com)

💤 Run Chrome in headless mode? (y/n)

📸 Choose a name for your screenshot

The screenshot will save as images/<your_name>.png.


❗ Notes & Troubleshooting

webdriver-manager auto-downloads the correct ChromeDriver version for you.

If driver download hangs (e.g., behind a firewall), try VPN or manual ChromeDriver install.

Test script for debugging driver issues:

from selenium import webdriver from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager import time

options = webdriver.ChromeOptions()

options.add_argument("--headless") # Uncomment for headless

service = Service(ChromeDriverManager().install()) driver = webdriver.Chrome(service=service, options=options) driver.get("https://www.google.com") time.sleep(5) driver.quit()


📄 License

MIT License — see the LICENSE file for details.


If you want me to generate requirements.txt, LICENSE, or even a demo GIF for this README, just ask! 😊

About

Automate web page screenshot capturing with Python and Selenium WebDriver for efficient and reliable image generation.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages