【发布时间】:2012-12-18 02:34:15
【问题描述】:
我想知道scrapy中request对象返回的是什么类型的对象
http://doc.scrapy.org/en/latest/topics/request-response.html
假设这是我的要求
myrequest = Request("http://www.example.com", callback = self.mytest)
现在我想知道myrequest 变量中的内容。
有什么方法可以覆盖 Request 对象,因为我想创建返回响应对象的MYREQUEST,以便我可以访问resposne.body,resposne.url
myvar =MYREQUEST("http://www.example.com", callback = self.mytest)
然后我可以访问myvar.body 和myvar.url
我无法从 git hub 中找到请求类定义,该类在哪里定义。 我只能在那里找到请求文件夹,但找不到请求类 https://github.com/scrapy/scrapy/tree/master/scrapy/http
【问题讨论】:
-
不能直接用
type()来查找对象的类型吗?