摘要: 就是将图片中<li class="row">的标签删除掉,因为这个标签是广告标签,所以需要将这个标签剔除掉。 阅读全文
posted @ 2019-03-28 18:26 乔儿 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-03-21 23:09 乔儿 阅读(172) 评论(0) 推荐(0) 编辑
摘要: βҳ转换为正常的中文: 阅读全文
posted @ 2019-03-21 22:49 乔儿 阅读(4353) 评论(1) 推荐(1) 编辑
摘要: 过滤函数,作用就是将“以‘居’结尾的字段都过滤出来,其它的字段都删除掉。” 阅读全文
posted @ 2019-03-20 22:05 乔儿 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-03-19 10:57 乔儿 阅读(122) 评论(0) 推荐(0) 编辑
摘要: a = ‘https://www.baidu.com/s?wd=%E7%AE%80%E4%B9%A6&rsv_spt=1&rsv_iqid=0xdfa3666f00083a6f&issp=1&f=8&rsv_bp=0&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_en 阅读全文
posted @ 2019-03-17 16:16 乔儿 阅读(582) 评论(0) 推荐(0) 编辑
摘要: Rule(LinkExtractor(allow=r'i/tems'),callback='parse_item',follow=True) 当前代码的含义就是将当前页面及按照allow=r'i/tems'规则找出来的url的代码返回给callback='parse_item'或者供下一个rule使 阅读全文
posted @ 2019-03-16 11:54 乔儿 阅读(438) 评论(0) 推荐(0) 编辑
摘要: <div class="uibox-con carpic-list03 border-b-solid"> #即这个标签同时满足三个class:“uibox”、“carpic-list03”、“border-b-solid”。 提取此标签时:html.xpath("//div[contains(@cl 阅读全文
posted @ 2019-03-14 21:58 乔儿 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-03-14 15:49 乔儿 阅读(104) 评论(0) 推荐(0) 编辑
摘要: # for url in urls:# url = response.urljoin(url)# print(url)urls = map(lambda url:response.urljoin(url),urls)print(urls)在这里要情调的是map函数运行完之后会生成一个map对象(<m 阅读全文
posted @ 2019-03-14 13:45 乔儿 阅读(777) 评论(0) 推荐(0) 编辑