摘要: os.path.isfile will return false if the argument is not a file: that is, it is a directory, or it does not exist. os.path.exists returns if it is a va 阅读全文
posted @ 2020-05-26 08:46 天冰老冰棍 阅读(334) 评论(0) 推荐(0)
摘要: [item for item in os.listdir('/') if os.path.isdir(item)] 返回是空,这肯定是不对的,根目录下明明有很多目录的。 原来os.path.isdir检查的目录是在当前目录下的,而不是os.listdir清单('/')下的目录下,我的目录并没有切到/ 阅读全文
posted @ 2020-05-26 08:16 天冰老冰棍 阅读(591) 评论(0) 推荐(0)
摘要: 软件版本 selenium:3.141.0 geckodriver:0.26.0 firefox:firefox 75.0. 网上搜索资料都说是driver和浏览器版本不符合,但是去git上看了文档 这个版本匹配是没有问题的。尝试在调用浏览器时加上路径即可解决。 即:driver = webdriv 阅读全文
posted @ 2020-04-29 07:28 天冰老冰棍 阅读(251) 评论(0) 推荐(0)
摘要: 学习分布式进程时该书用的python2.x,代码为 manager = QueueManager(address=('127.0.0.1', 8001), authkey='qiye') 运行报错TypeError: string argument without an encoding 在pyth 阅读全文
posted @ 2020-04-14 08:27 天冰老冰棍 阅读(3699) 评论(0) 推荐(0)
摘要: 1.urllib2在python3中已经没了,使用urllib3 相应代码也要做更改 原代码 : response = urllib2.urlopen(url) data = response.read() 改为 http = urllib3.PoolManager()response = http 阅读全文
posted @ 2020-04-13 16:59 天冰老冰棍 阅读(363) 评论(0) 推荐(0)