Skip to main content

Python website screen grabber

Project description

pyshotty

A firefox selenium based screenshot package for use with flask

Error while running selenium in a flask route brought me to create this.

Although that I realised soon my error was elsewhere, I now have a condensed easy format to grab website screenshots

Prerequisites

  • Ubuntu
  • Firefox sudo apt-get install firefox
  • geckodriver sudo apt-get install firefox-geckodriver

Features

  • Grab screenshots from any website (in .png, .jpg or PIL image format)
  • Choose browser size (essentially screenshot size)

Installation

Download and install can be done through PyPi

pip install pyshotty

or

git clone https://github.com/lewis-morris/pyshotty
cd pyshotty 
pip install -e .

Pending Features

  • Alternative image formats
  • grab via Chrome selenium
  • passing command line parameters

How to use

Minimal working example

from pyshotty import Firefox

screen = Firefox()
filename = screen.grab("www.google.com")

output: /tmp/tempscreenshot.png

Image

Full Example

I always find it best to learn by example so follow this jupyter notebook to see the flow.

Jupyter notebook examples

All classes have doc strings, so you can always check there if you get stuck.

Contact

If you have any issues or just want to chat you can always email me at lewis.morris@gmail.com or open an issue.

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

pyshotty-0.0.3.5.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

pyshotty-0.0.3.5-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file pyshotty-0.0.3.5.tar.gz.

File metadata

  • Download URL: pyshotty-0.0.3.5.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

File hashes

Hashes for pyshotty-0.0.3.5.tar.gz
Algorithm Hash digest
SHA256 87a465d5f913ecc4a7bbcf90adcf5655873abfaf8b8ffc1c056a8b4c2656b512
MD5 7be476b9d127a490d3c1b9e444648347
BLAKE2b-256 7dd7277036a712d0ebf5c2652f6b6bca5dc32bfa09d4bb6ecb2b1cf7a4165919

See more details on using hashes here.

File details

Details for the file pyshotty-0.0.3.5-py3-none-any.whl.

File metadata

  • Download URL: pyshotty-0.0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

File hashes

Hashes for pyshotty-0.0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cd6124995704a3a2de6231bf906b1128c0fc3c3648692c8e24f195d0fc7ef376
MD5 3ce4de0e813a8ed228e7b22b8d6ffae5
BLAKE2b-256 322ffe8f0bd723d47af1a8313ddeac2e99b17deb793025a55c4d9576699dffbe

See more details on using hashes here.

Supported by

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