Skip to content

Commit 5eb6521

Browse files
authored
Merge pull request #144 from Sachit71/patch-1
🎉 Website Screenshot Feature
2 parents 2941469 + 7b8bd98 commit 5eb6521

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pywhatkit/misc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ def take_screenshot(
1818
screen = ImageGrab.grab()
1919
screen.show(title=file_name)
2020
screen.save(f"{file_name}.png")
21-
21+
def web_scr(link:str) -> None:
22+
BASE = 'https://render-tron.appspot.com/screenshot/'
23+
url = link
24+
path = 'ScreenShot.jpg'
25+
response = requests.get(BASE + url, stream=True)
26+
if response.status_code == 200:
27+
with open(path, 'wb') as file:
28+
for chunk in response:
29+
file.write(chunk)
2230

2331
def show_history() -> None:
2432
"""Prints the Log File Generated by the Library"""

0 commit comments

Comments
 (0)