I am trying to follow this example of generating a click on the extension. below is my code
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import pyautogui
import json
import os
from Common_Methods.GenericMethods import *
options = webdriver.ChromeOptions()
options.add_argument("--load-extension=./Edit-This-Cookie")
driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=options)
driver.get("https://google.com")
# get the extension box
extn = pyautogui.locateOnScreen(os.path.join(GenericMethods.get_full_path_to_folder() + "/icon_16x16.png"))
# click on extension
pyautogui.click(x=extn[0],y=extn[1],clicks=1,interval=0.0,button="left")
I am getting the error
from Common_Methods.GenericMethods import *
ModuleNotFoundError: No module named 'Common_Methods'
I tried to check if there is any module by that name in pip, but there are none.
I am presently using python version 3.9.0
, I tried switching to 2.7
but the package still seems missing.
EDIT:
removing the from Common_Methods.GenericMethods import *
gives the following error:-
NameError: name 'GenericMethods' is not defined