示例:
def start_requests(self):
urls = ['www.google.com', 'www.stackoverflow.com' ...] # only google or stackoverflow
for url in urls:
if url.startswith("www.google.com"):
yield Request(url, callback=self.parse)
elif url.startswith("www.stackoverflow.com"):
yield Request(url, callback=self.parse_stack)
def parse(self,response): ~
def parse_stack(self,response): ~
我想为每个域制定解析规则。有什么推荐的解析技术吗?