We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent decce19 commit 3cdf07aCopy full SHA for 3cdf07a
pywhatkit/core/core.py
@@ -34,10 +34,12 @@ def close_tab(wait_time: int = 2) -> None:
34
35
def findtextbox() -> None:
36
"""click on text box"""
37
+ global location
38
+ dir_path = os.path.dirname(os.path.realpath(__file__))
39
try:
- location = locateOnScreen(os.path.join('data', 'pywhatkit_smile1.png'))
- except ImageNotFoundException:
40
- location = locateOnScreen(os.path.join('data','pywhatkit_smile.png'))
+ 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")
43
moveTo(location[0] + 150, location[1] + 5)
44
click()
45
0 commit comments