Scrapy 奇怪的输出,但适用于 curl

Scrapy strange output but works with curl

我在 scrapy 命令下运行

scrapy shell "https://www.vr.de/service/filialen-a-z/a.html'

在 return 中,我得到如下数据,

该数据没有任何信息。

如果我使用 curl 获取数据,那么所有信息都是准确的。

有人可以告诉我我做错了什么吗?

用户 headers 在 scrapy shell

>>> url = 'https://www.vr.de/service/filialen-a-z/a.html'
>>> headers={"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B179 Safari/7534.48.3"}
>>> r=scrapy.Request(url, headers=headers)
>>> fetch(r)
2021-05-08 16:12:27 [scrapy.core.engine] DEBUG: Crawled (200) <GET https://www.vr.de/service/filialen-a-z/a.html> (referer: None)
>>> for data in response.css('div.module.module-teaser.ym-clearfix'):
...     print(data.css('a::attr("href")').get())
...     print(data.css('div.text::text').get())