File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 1+ import os
12import time
23import webbrowser as web
34from platform import system
@@ -18,16 +19,25 @@ def take_screenshot(
1819 screen = ImageGrab .grab ()
1920 screen .show (title = file_name )
2021 screen .save (f"{ file_name } .png" )
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 )
22+
23+
24+ def web_screenshot (
25+ link : str ,
26+ filename : str = "Screenshot.jpg" ,
27+ path : str = os .getcwd (),
28+ width : int = 1613 ,
29+ height : int = 786 ,
30+ ) -> None :
31+ """Take Screenshot of Any Website Without Opening it"""
32+
33+ url = f"https://render-tron.appspot.com/screenshot/{ link } /?width={ width } &height={ height } "
34+ response = requests .get (url , stream = True )
2635 if response .status_code == 200 :
27- with open (path , 'wb' ) as file :
36+ with open (os . path . join ( path , filename ), "wb" ) as file :
2837 for chunk in response :
2938 file .write (chunk )
3039
40+
3141def show_history () -> None :
3242 """Prints the Log File Generated by the Library"""
3343
You can’t perform that action at this time.
0 commit comments