![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据采集
文章平均质量分 95
_hankang
独立思考,脑洞大开
展开
-
XPath学习笔记
使用lxml对爬取的网页数据进行解析时,最长使用的方式是xpath,在Scrapy爬虫框架中也提供了相应的函数调用.xpath()和.css(), css()的方式实质上底层仍然被转换成xpath方式进行处理。1.XPath基础语法首先是xpath的基本使用方法,如图: 2. XPath with Pythonfrom lxml import etreehtml_doc = """<htm原创 2017-07-30 21:23:15 · 451 阅读 · 0 评论 -
BeautifulSoup简记
对象类型BeautifulSoup对象Tag对象NavigableString对象html_doc = """<html><head><title>The Dormouse's story</title></head><p class="title"><b>The Dormouse's story</b></p><p class="story">Once upon a time there原创 2017-07-30 21:36:01 · 592 阅读 · 0 评论 -
Scrapy使用简记
1.安装scrpy关于名字,Scrapy = S + crawl +py ???. 基于Python3.x的scrapy使用,首先配置virtualenv配置python虚拟环境,详见. 在虚拟环境中安装scrapy,使用国内豆瓣源安装: pip install -i https://pypi.douban.com/simple scrapy 如果安装或编译出错,则使用这里已经编译好原创 2017-08-13 18:06:32 · 495 阅读 · 0 评论