import scrapy
# from scrapy.xcc_items.factoryitems import FactoryCatergoryItem,FactoryMaterialItem

class TestCookiesSpider(scrapy.Spider):
    '''
    测试scrapy settings所传参数是否能请求到有效页面
    包含cookie测试/header测试/ip测试/请求头测试
    '''
    name = 'testcrawl'
    start_urls = ['http://test.abuyun.com/'] #<---请求头测试 get/post
    start_urls = ['http://httpbin.org/get'] #<---请求头测试 get
    def parse(self, response):
        print(response.text)
        #with open('test.html','wb') as f:
        #    f.write(response.body)