Skip to main content

copy all tab URLs from a browser window

Project description

Tabshot

Tabshot is a script that fetches all URLs from a browser window by iterating over the open tabs. This is achieved in an ineloquent way, but one which should work for most browsers (see How the script works for more).

Requirements

  • pyautogui
  • pyperclip
  • pynput

Usage and Commands

print

  • prints the list of URLs to the terminal
  • usage: tabshot print or tabshot p

save

  • saves the list of URLs to a json file (see Output file schema)
  • usage: tabshot save <outfile> or tabshot s <outfile>
  • add a description: tabshot s "div centre" -d "useful links for how to centre a div"
  • outfile is saved to the /output directory

load

  • opens URLs from a saved file in a new (default) browser window
  • usage: tabshot load <infile> or tabshot l <infile>

Notes

How the script works

Tabshot uses pyautogui to execute keyboard shortcuts to iterate over the browser tabs and copy the URL of each tab.

Iterating over the browser tabs is performed by using the ctrl-tab keyboard shortcut. Ensure that the browser settings are enabled to allow this behaviour.

When two duplicate tab URLs have been encountered, the iteration over browser tabs will cease.

Terminating the script

To terminate the script whilst the browser tabs are being iterated over:

  1. Provide mouse or keyboard input other than the following keys: 'ctrl', 'tab', 'c', 'v', 't', 'l', 'enter', or
  2. Move the mouse to any corner of the screen (this is the default behaviour of pyautogui)

Output file schema

  • the save command outputs a json file to /output with the following schema:
{
    "title": "",
    "description": "",
    "datetime_created": "",
    "num_urls": "",
    "urls": []
}
  • title corresponds to the argument passed as outfile to the save command
  • input files passed to the load command must adhere to this schema in order to be valid

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

tabshot-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

tabshot-1.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file tabshot-1.0.0.tar.gz.

File metadata

  • Download URL: tabshot-1.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.1

File hashes

Hashes for tabshot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fbd381465e7d6006699043b9e462d9b4d76d20f50082c0fe4964c23fb4ddb8e6
MD5 4b0a6fb3e5d65b3d346bf49a549c14b8
BLAKE2b-256 c001467ab35c61d2158f8f4b8deaa37ce6bde2cb9dc2fd2f9540889c80d7714b

See more details on using hashes here.

File details

Details for the file tabshot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tabshot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.1

File hashes

Hashes for tabshot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8ac2d3da1d6a61447ce1c5f92c61c664b70d504a320dfceaafef9bc3386e9bf
MD5 836fcc6540f2ecda95e702fca13c73cb
BLAKE2b-256 18da1729785c990360d43c10b256a430b0971a83e2bc5b9c3ea9a98df6dc1e9c

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