Browser

phantomjs 设置代理

phantomjs 可通过以下设置代理ip #coding=utf-8import osimport reimport timeimport requestsfrom scrapy.selector import HtmlXPathSelectorfrom scrapy.http import HtmlResponsefrom selenium impor...

selenium实现淘宝的商品爬取

一、问题 本次利用selenium自动化测试,完成对淘宝的爬取,这样可以避免一些反爬的措施,也是一种爬虫常用的手段。本次实战的难点: 1.如何利用selenium绕过淘宝的登录界面 2.获取淘宝的页面内容实现翻页,并判断是否翻页成功。 3.获取每一页的信息,实现数据的抓取工作。  4.环境python3.6,对应的Chrome的webdriver驱动网址:...

python+selenium动态抓取网页数据

window+python+selenium 1.下载selenium cmd pip3 instatll selenium 2.下载浏览器对应驱动版本 查看浏览器版本:chrome://version 驱动下载国外连接:http://chromedriver.storage.googleapis.com/index.html 驱动下载国内镜像连接(推荐...

Python——截取web网页长图

# -*- coding: utf8 -*-import timeimport xlrdfrom selenium import webdriverdef read_excel(filename): data = xlrd.open_workbook(filename) # 打开xls文件 sheet = data.sheets()[0]...

ueditor解决超链接、预览无效问题

最近在某项目中引用了ueditor,并没有注意到除了文本编辑与上传图片以外的功能是否完好。后面测试提了俩bug,发现超链接与预览无效的问题,业务需求确实需要这俩功能,还是得解决。 在点击超链接或预览按钮的时候,发现控制台报错:Uncaught ReferenceError: editor is not undefined at link.html,大致就是...