Skip to content

Commit 7c55919

Browse files
authored
final change (now dark mode working too
1 parent 66c561e commit 7c55919

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pywhatkit/core/core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ def close_tab(wait_time: int = 2) -> None:
4343

4444
def findtextbox() -> None:
4545
"""click on text box"""
46-
global location
4746
dir_path = os.path.dirname(os.path.realpath(__file__))
47+
location = locateOnScreen(f"{dir_path}\\data\\pywhatkit_smile1.png")
4848
try:
49-
location = locateOnScreen(f"{dir_path}\\data\\pywhatkit_smile1.png")
50-
except ImageNotFoundException or location is None:
49+
moveTo(location[0] + 150, location[1] + 5)
50+
except Exception:
5151
location = locateOnScreen(f"{dir_path}\\data\\pywhatkit_smile.png")
52-
moveTo(location[0] + 150, location[1] + 5)
52+
moveTo(location[0] + 150, location[1] + 5)
5353
click()
5454

5555

0 commit comments

Comments
 (0)