LOG_LEVEL = ‘WARNING‘
import sys
import scrapy
import logging
class QuotesSpider(scrapy.Spider):
name = "taobao"
start_urls = [
‘https://ai.taobao.com/‘,
]
logger = logging.getLogger(__name__)
def parse(self, response):
links = response.xpath(‘//div[@class="chanel-tags clearfix"]//a‘)
self.logger.warning(links)
原文:https://www.cnblogs.com/MartinTai/p/14687304.html