Type[Union[Firefox, Chrome, Ie, Edge]] = Chrome报错
来源:3-4 继承基类实现浏览器个性化

qq_Qian儭_03543846
2021-11-10
def init(self,
browser_type: Type[Union[Firefox, Chrome, Ie, Edge]] = Chrome,
option_type: Type[Union[FirefoxOptions, ChromeOptions, IeOptions]] = ChromeOptions,
driver_path: str = CHROME_DRIVER_PATH):
会报以下错误:
Traceback (most recent call last):
File “E:/pyworkspace/frameworkdemo/bo_demo/BrowseBase.py”, line 19, in
class BROWSER(object):
File “E:/pyworkspace/frameworkdemo/bo_demo/BrowseBase.py”, line 31, in BROWSER
driver_path: str = CHROME_DRIVER_PATH):
NameError: name ‘Type’ is not defined
写回答
1回答
-
qq_Qian儭_03543846
提问者
2021-11-11
这个问题已解决,没导入包导致,以为是版本问题
022022-01-25
相似问题