Created
January 2, 2022 20:05
-
-
Save WilliamNT/6e33af2494af7350fd6e0ea2ef7413d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the line "with open(f"IMG_.png", "wb") as f" replace IMG_ with anything you'd like to name the file.