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

Method parse

tests/task-spider/test_task_spider.py:23–31  ·  view source on GitHub ↗
(self, request, response)

Source from the content-addressed store, hash-verified

21 yield feapder.Request(url, task_id=task_id)
22
23 def parse(self, request, response):
24 # 提取网站title
25 print(response.xpath("//title/text()").extract_first())
26 # 提取网站描述
27 print(response.xpath("//meta[@name='description']/@content").extract_first())
28 print("网站地址: ", response.url)
29
30 # mysql 需要更新任务状态为做完 即 state=1
31 # yield self.update_task_batch(request.task_id)
32
33
34def start(args):

Callers

nothing calls this directly

Calls 1

xpathMethod · 0.80

Tested by

no test coverage detected