i want to click a button on an extension. But i don't know about how can i do it. I couldn't find any source for it. Can anyone help me about this?
Asked
Active
Viewed 450 times
0
-
Update the question with the relevant HTML and your code trials – undetected Selenium Jan 24 '22 at 20:33
1 Answers
0
I found this solution for the C#, I hope this will work for you as well.
In case you are coding with Python this should work for you:
This can be done with use of pyautogui
tool.
Install pyautogui
, then get the image of the extension icon and save it on your computer in some location like ./icon.png
.
Now you will be able to click on the extension as following:
import pyautogui
img_location = pyautogui.locateOnScreen('./icon.png', confidence=0.5)
image_location_point = pyautogui.center(img_location)
x, y = image_location_point
pyautogui.click(x, y)
Credits to the author

Prophet
- 32,350
- 22
- 54
- 79
-
-
-
-
I made a mistake and then corrected myself. So I mentioned a link to C# solution in the first part for the OP and added a Python solution after that since most Selenium users are working with Python these days – Prophet Jan 24 '22 at 22:05