scrapy:不同的URL

时间:2017-08-25 07:07:47

标签: python scrapy scrapy-spider

在向URL发出请求时遇到问题。 在主页面检查时,我将href中的URL设为enter image description here

但是当链接打开时,它似乎是:enter image description here

两个链接都不同,我该如何提出请求。

这是我的shell所说的:enter image description here

1 个答案:

答案 0 :(得分:3)

问题在于allowed_domains spider属性。您当前的设置不允许您按照日志(DEBUG: Filtered offsite request to ...)跟踪对 jobview.monster.ca 的请求。稍微松散地设置该属性:

allowed_domains = ['monster.ca']