def parse(self, response): self.logger.debug("parsing %s" % response.url) self.handle_response(response) args = { "name": self.name, "location": response.meta["location"], "keyword": response.meta["keyword"], # 'item': 'list', "item": url2filename(response.url), "time": now_timestamp(), } save_html(response.body, args)
def parse_item(self, response): self.logger.debug("parse_item %s" % response.url) item = response.meta["item"] args = { "name": self.name, "location": item["location_search"], "keyword": item["keyword"], # 'item': string2filename(item['title']), "item": url2filename(item["item_url"]), "time": now_timestamp(), } save_html(response.body, args) return item