
爬虫
文章平均质量分 72
童话里做英雄529
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
scrapy实现二级页面爬取(以小说为例)
1.scrapy图解 2.创建项目 scrapy startproject 项目名 创建后的目录 3.编写字段 在items.py中编写需要的字段,这里就写小说的章节和内容 class XiaoshuoItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() ...原创 2019-07-23 20:26:46 · 4404 阅读 · 0 评论 -
python爬虫之pyquery
1.初始化 from pyquery import PyQuery as pq html_str=''' <div class="wrap"> <div id="container"> <ul class='list'> <li class="item-0">first item</li> ...原创 2019-07-17 19:25:59 · 315 阅读 · 0 评论 -
BeautifulSoup的使用
1.find_all() 注意点: 1.返回的是列表 2.name用来指定需要匹配的tag 传入:字符串,正则,列表(查询多个标签) # 获取所有的a标签 a=html_doc.find_all('a') #获取以l开头的标签 print(html_doc.find_all(re.compile('^l'))) # 获取所有的img和a标签 imganda = html_doc.find_all(...原创 2019-07-17 19:48:32 · 150 阅读 · 0 评论 -
MangoDB的增删查改
1.插入 1.不指定id db.stu.insert({name:'张三',age:18}) 2.指定id db.stu.insert({_id:'1',name:'张小三',age:18}) id可以自己设置,不设置会自动生成唯一值。 2.修改 (1)全文档更新(前面的{}里指定对象,后面的{}里修改内容) db.stu.update({name:'张三'},{name:'张大',age:2...原创 2019-07-19 20:18:45 · 278 阅读 · 0 评论