首页 » Python » python定向爬虫:最简单的scrapy抓取

python定向爬虫:最简单的scrapy抓取

 
#coding:utf-8

import scrapy
query = '我去学习'
a = open("C:/Users/Administrator/Desktop/123.txt","w")
class DmozSpider(scrapy.Spider):
    name = 'seo'
    
    start_urls = ['http://www.baidu.com/s?wd=%s' % query]
    
    def parse(self,response):
        html = response.body
        a.write(html)
        print "完成抓取"


原文链接:python定向爬虫:最简单的scrapy抓取,转载请注明来源!

0