idea创建python项目报Unresolved reference ‘xxx’….之解决办法


点击“+”,add相应的包。
注意:如还未下载,pip命令使用的应为pip install pillow而不是pip install pil
如何查看xpath

进入开发者模式后,选中想要获取xpath路径的元素,对应html中的相应位置。
右键选择copy xpath即可。
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
意思是元素隐藏不可见,是因为页面元素不可见,如页面缩小了,将页面最大化即可。
driver = webdriver.Chrome()driver.maximize_window() # 最大化页面driver.get('http://www.baidu.com')
raise WebDriverException("Can not connect to the Service %s" % self.path)selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /usr/local/bin/chromedriver
修改原脚本如下所示,将具体的驱动位置作为入参。
path = "/usr/local/bin/chromedriver"driver = webdriver.Chrome(path)
在脚本里加上了驱动位置以后还是出现了报错
解决这个问题在/etc/hosts文件中将127.0.0.1 localhost加上即可。
Traceback (most recent call last): File “/Users/pandab/Desktop/pythonTest/CloudMusic/test.py”, line 59, in
runner = HTMLTestRunner(stream=file, title="网易云登陆测试报告", description="用例执行情况:")TypeError: ‘module’ object is not callable
