MCPcopy Create free account
hub / github.com/Boris-code/feapder / parse

Method parse

tests/test_template/test_spider.py:32–40  ·  view source on GitHub ↗
(self, request, response)

Source from the content-addressed store, hash-verified

30 yield feapder.Request(url, task_id=task_id)
31
32 def parse(self, request, response):
33 # 提取网站title
34 print(response.xpath("//title/text()").extract_first())
35 # 提取网站描述
36 print(response.xpath("//meta[@name='description']/@content").extract_first())
37 print("网站地址: ", response.url)
38
39 # mysql 需要更新任务状态为做完 即 state=1
40 yield self.update_task_batch(request.task_id)
41
42
43if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

xpathMethod · 0.80
update_task_batchMethod · 0.45

Tested by

no test coverage detected