Skip to content

Capture screenshots of web pages in multiple form factors.

License

Notifications You must be signed in to change notification settings

Webinative/screenshot.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot.py

Capture full-page screenshots of webpages in the follwing form factors,

Device / Orientation Width (px) Height (px)
iPhone 8 375 667
iPad Portrait 768 1024
iPad Landscape 1024 768
Laptop 1280 720
Desktop 1440 800
Full HD 1920 1080

Prerequisites

  • Python (>=3.7)

Installation

# clone the repository
git clone [email protected]:Webinative/screenshot.py.git

cd screenshot.py

# create new virtual environment
python3 -m venv venv

# activate virtual environment
source venv/bin/activate

# install the required packages
python3 -m pip install -r requirements.txt

# download playwright browsers
playwright install

Usage

python screenshot.py --url https://example.com --browser chrome

The above command captures screenshots of the given URL and saves them to the "screenshots" folder.

Command-line Arguments

Argument Description
--url The URL of the webpage to capture screenshots.
--browser The browser (engine) to use for capturing screenshots (default: chrome).

Support for chromium, firefox, safari and edge coming soon.

Customisation

Modify the utils.py file to customise further.

  • form_factors - Add, edit or remove devices / screen sizes.
  • save_folder – Change the target folder where screenshots are saved.

About

Capture screenshots of web pages in multiple form factors.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages