鱼C论坛

 找回密码
 立即注册
分享 58租房信息爬虫
2017-3-23 15:46
rent_spider.py import scrapy import re from rent_58.items import Rent58Item class Rent58Spider(scrapy.Spider): name = "Rent58" allowed_domains = start_urls = def parse(self, response): items = /ul /li') for site in sites: item = Rent58Item() tr ...
个人分类: 学习笔记|813 次阅读|0 个评论
分享 书中爬DMOZ网站例子修改
2017-3-17 14:13
import scrapy from tutoria.items import DmozItem class DmozSpider(scrapy.Spider): name = "dmoz" allowed_domains = start_urls = def parse(self, response): sel = scrapy.selector.Selector(response) sites = sel.xpath('//div /div ') items = = site.xpath(' ...
个人分类: 学习笔记|712 次阅读|0 个评论

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-20 17:57

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部