# -*- coding: utf-8 -*- import scrapy class BaiduSpider(scrapy.Spider): name = 'baidu' allowed_domains = ['baidu.com'] start_urls = ['http://baidu.com/'] def parse(self, response): # print('结果返回') print(response) print(type(response)) # print('结果结束') html = str(response.body,encoding="utf8") with open("baidu.html","w",encoding="utf8")as f: f.write(html)
scrapy 试用 爬取百度首页
猜你喜欢
转载自blog.csdn.net/qq_24137739/article/details/79782099
今日推荐
周排行