摘要: from selenium import webdriverdriver = webdriver.Firefox(executable_path = "C:/Insert/Firefox/geckodriver.exe")driver.get("http://www.baidu.com")drive 阅读全文
posted @ 2017-01-12 22:08 有态度 阅读(619) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriverimport timeimport os path = os.path.dirname(__file__)# print(path)driver = webdriver.PhantomJS(executable_path='C:/Inser 阅读全文
posted @ 2017-01-11 21:36 有态度 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 原文链接: http://www.cnblogs.com/fnng/archive/2013/05/29/3106515.html 1.起因:在网页抓取的过程中,有些内容是通过js加载的,但是直接抓取是抓取不到的 2.selenium+python 映入眼帘 3.selenium 是一个web的自动 阅读全文
posted @ 2017-01-11 17:54 有态度 阅读(185) 评论(0) 推荐(0) 编辑
摘要: "Accept-Encoding": "gzip, deflate", 这条信息代表本地可以接收压缩格式的数据,而服务器在处理时就将大文件压缩再发回客户端,IE在接收完成后在本地对这个文件又进行了解压操作。出错的原因是因为你的程序没有解压这个文件,所以删掉这行就不会出现问题了 阅读全文
posted @ 2017-01-10 00:26 有态度 阅读(73994) 评论(3) 推荐(0) 编辑
摘要: #添加的表结构字段分辨是(id,title,summary,visits,accountName,grabTime) #其中id,是int自增主键,在添加操作的时候,不需要对id进行操作 conn = mysql.connector.connect(user='root',password='',d 阅读全文
posted @ 2016-12-29 17:39 有态度 阅读(13594) 评论(1) 推荐(0) 编辑
摘要: 错误内容:UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128) 1.以为是代码错误,检查tab符,并没有问题, 2.将代码粘贴到空白项目中去,发现还 阅读全文
posted @ 2016-12-29 14:56 有态度 阅读(5527) 评论(0) 推荐(0) 编辑
摘要: 安装第三方库:pip install Pillow 出现 You are using pip version 7.1.2, however version 9.0.1 is available. You should consider upgrading via the 'python -m pip 阅读全文
posted @ 2016-12-02 09:38 有态度 阅读(14387) 评论(1) 推荐(0) 编辑