scrapy yield请求不工作

时间:2016-10-14 04:47:22

标签: scrapy scrapy-spider

我写了下面的scrapy蜘蛛,但是在初始请求之后它没有继续爬行过程,尽管我已经let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) guard let jsonDictionary = jsonObject as? [String: Any], let photos = jsonDictionary["photos"] as? [String: AnyObject], // this line is giving the error let photosArray = photos["photo"] as? [[String: Any]] else { print("Error") } print(jsonDictionary) 更多yield s用于scrapy跟随。

scrapy.Request

1 个答案:

答案 0 :(得分:2)

allowed_domains必须是a list of domains,而不是网址列表。

所以它应该是:

allowed_domains = ['blog.scrapinghub.com']