mirror of
https://github.com/FranP-code/classify_saved_videos_yt.git
synced 2025-10-13 00:32:25 +00:00
fix error on browser location error
This commit is contained in:
16
script.py
16
script.py
@@ -23,15 +23,15 @@ listener.start()
|
|||||||
|
|
||||||
# Enter the name of your browser, based on the name of its icon image.
|
# Enter the name of your browser, based on the name of its icon image.
|
||||||
browser_img = 'brave.png'
|
browser_img = 'brave.png'
|
||||||
|
try:
|
||||||
|
browser_loc = pgui.locateCenterOnScreen(f'img/{browser_img}', confidence=0.8)
|
||||||
|
|
||||||
browser_loc = pgui.locateCenterOnScreen(f'img/{browser_img}', confidence=0.8)
|
if browser_loc:
|
||||||
|
pgui.moveTo(browser_loc, duration=0.2)
|
||||||
if browser_loc:
|
pgui.click()
|
||||||
pgui.moveTo(browser_loc, duration=0.2)
|
# Change the time depending on how long it takes to open your browser
|
||||||
pgui.click()
|
time.sleep(2)
|
||||||
# Change the time depending on how long it takes to open your browser
|
except (pgui.ImageNotFoundException, Exception):
|
||||||
time.sleep(2)
|
|
||||||
else:
|
|
||||||
print("Browser icon not found.")
|
print("Browser icon not found.")
|
||||||
sys.exit('closing script')
|
sys.exit('closing script')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user