Skip to content

Commit 3cdf07a

Browse files
committed
working
1 parent decce19 commit 3cdf07a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pywhatkit/core/core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ def close_tab(wait_time: int = 2) -> None:
3434

3535
def findtextbox() -> None:
3636
"""click on text box"""
37+
global location
38+
dir_path = os.path.dirname(os.path.realpath(__file__))
3739
try:
38-
location = locateOnScreen(os.path.join('data', 'pywhatkit_smile1.png'))
39-
except ImageNotFoundException:
40-
location = locateOnScreen(os.path.join('data','pywhatkit_smile.png'))
40+
location = locateOnScreen(f"{dir_path}\\data\\pywhatkit_smile1.png")
41+
except ImageNotFoundException or location[0] is None:
42+
location = locateOnScreen(f"{dir_path}\\data\\pywhatkit_smile.png")
4143
moveTo(location[0] + 150, location[1] + 5)
4244
click()
4345

0 commit comments

Comments
 (0)