我试图按照this示例生成对扩展的单击。 下面是我的代码
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")
我发现了错误
from Common_Methods.GenericMethods import *
ModuleNotFoundError: No module named 'Common_Methods'
我试图检查在pip中是否有同名的模块,但没有。
我目前正在使用python版本3.9.0
,我尝试切换到2.7
,但包似乎仍然丢失
编辑:
删除from Common_Methods.GenericMethods import *
给出以下错误:-
NameError: name 'GenericMethods' is not defined
这似乎是一个特定于其框架的包,您只需将其删除即可
相关问题 更多 >
编程相关推荐