摘要: python2 + selenium + eclipse 中,配置好runserver 127.0.0.1:9000,运行的时候,报错,如图: 原来: import django.core.handlers.wsgi application = django.core.handlers.wsgi.W 阅读全文
posted @ 2017-06-19 15:15 qiao1234 阅读(323) 评论(0) 推荐(0) 编辑
摘要: python2 + selenium + eclipse 中,通过django生产数据库表的时候报错 解决: 1.查看自己电脑中,“开始-->控制面板-->管理工具-->服务-->mysql56-->启动服务”,是否停止了mysql服务。 阅读全文
posted @ 2017-06-19 15:13 qiao1234 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 普通字符串可以用多种方式编码成Unicode字符串,具体要看你究竟选择了哪种编码: unicodestring = u"Hello world" # 将Unicode转化为普通Python字符串:"encode" utf8string = unicodestring.encode("utf-8") 阅读全文
posted @ 2017-06-19 15:10 qiao1234 阅读(35959) 评论(0) 推荐(1) 编辑
摘要: 阅读全文
posted @ 2017-06-19 15:10 qiao1234 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 一、十八种定位方法 前八种是大家都熟悉的,经常会用到的 1.id定位:find_element_by_id(self, id_) 2.name定位:find_element_by_name(self, name) 3.class定位:find_element_by_class_name(self, 阅读全文
posted @ 2017-06-19 15:09 qiao1234 阅读(266) 评论(0) 推荐(0) 编辑
摘要: /退回上一级表单 driver.switchTo().defaultContent(); 如果上面行不通,访问以下网站: https://www.cnblogs.com/math98/p/11013579.html 如果定位不到元素,报selenium.common.exceptions.NoSuc 阅读全文
posted @ 2017-06-19 15:06 qiao1234 阅读(1895) 评论(1) 推荐(0) 编辑
摘要: #通过os.path.abspath()方法,打开图片的绝对路径,然后,定位上传按钮,然后,send_keys()方法中,添加这个文件路径就可以了 其中,如果要定位xpath路径,必须是input的路径,不然会找不到,对应的按钮,无法上传成功,如下图: 阅读全文
posted @ 2017-06-19 15:05 qiao1234 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 支持代码运行没问题,暂时没有找到真正解决办法,只能通过一下办法暂时解决。如下图: 阅读全文
posted @ 2017-06-19 15:03 qiao1234 阅读(4260) 评论(0) 推荐(0) 编辑
摘要: 解决办法:我把python.exe 修改为了python3.exe ,为了兼容python2, 后来把python2从环境变量里删除,把python3.exe修改为了python.exe 就解决了,再次运行就OK啦 阅读全文
posted @ 2017-06-19 15:02 qiao1234 阅读(1340) 评论(0) 推荐(0) 编辑
摘要: 解决:提示chrome driver没有放置在正确的路径下,于是下载chrome dirver,然后放置到C:\Python36的目录下,再次运行就OK了! 阅读全文
posted @ 2017-06-19 15:01 qiao1234 阅读(213) 评论(0) 推荐(0) 编辑