From fb46b5b7c313d27777711ed73a677faac2d87b69 Mon Sep 17 00:00:00 2001 From: FragrantOrchid <220110626@stu.hit.edu.cn> Date: Mon, 3 Aug 2026 18:20:03 +0800 Subject: [PATCH] Add sitemapspider auto lastmod to document --- docs/topics/spiders.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst index 8fbf0c52d..a4723d01d 100644 --- a/docs/topics/spiders.rst +++ b/docs/topics/spiders.rst @@ -856,6 +856,11 @@ SitemapSpider if date_time.year >= 2005: yield entry + def parse(self, response): + # At the same time, you can get lastmod from meta + item = your_item() + item["lastmod"] = response.meta.get("lastmod") + This would retrieve only ``entries`` modified on 2005 and the following years.