Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WilliamNT/6e33af2494af7350fd6e0ea2ef7413d7 to your computer and use it in GitHub Desktop.
Save WilliamNT/6e33af2494af7350fd6e0ea2ef7413d7 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
URL = input("Lightshot URL: ")
PAGE = requests.get(URL, headers={'User-Agent': 'Chrome'})
soup = BeautifulSoup(PAGE.content, "html.parser")
result = soup.find(id="screenshot-image").get("src")
with open(f"IMG_.png", "wb") as f:
f.write(requests.get(result).content)
print("Image saved successfully.")
@WilliamNT
Copy link
Author

In the line "with open(f"IMG_.png", "wb") as f" replace IMG_ with anything you'd like to name the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment