scrapy.request

https://doc.scrapy.org/en/latest/topics/request-response.html#request-objects

参数说明describe
url?(string)需要请求的urlthe URL of this request
callback?(callable)回调函数the function that will be called with the response of this request (once its downloaded) as its first parameter. For more information see?Passing additional data to callback functions?below. If a Request doesn’t specify a callback, the spider’s?parse()?method will be used. Note that if exceptions are raised during processing, errback is called instead.
method?(string)请求的方法,默认是GETthe HTTP method of this request. Defaults to?’GET’.
meta?(dict)这个属性的值可以在response中得到the initial values for the?Request.meta?attribute. If given, the dict passed in this parameter will be shallow copied.
body?(str?or?unicode)请求体the request body. If a?unicode?is passed, then it’s encoded tostr?using the?encoding?passed (which defaults to?utf-8). If?body?is not given, an empty string is stored. Regardless of the type of this argument, the final value stored will be a?str?(never?unicode?or?None).
headers?(dict)请求头the headers of this request. The dict values can be strings (for single valued headers) or lists (for multi-valued headers). If?None?is passed as value, the HTTP header will not be sent at all.
cookies?(dict?or?list)请求的cookiethe request cookies. These can be sent in two forms.
encoding?(string)此请求的编码(默认为’utf-8’)the encoding of this request (defaults to?’utf-8’). This encoding will be used to percent-encode the URL and to convert the body to?str?(if given as?unicode).
priority?(int)这个请求的优先级,默认是0the priority of this request (defaults to?0). The priority is used by the scheduler to define the order used to process requests. Requests with a higher priority value will execute earlier. Negative values are allowed in order to indicate relatively low-priority.
dont_filter?(boolean)默认False,是否请求同一个页面indicates that this request should not be filtered by the scheduler. This is used when you want to perform an identical request multiple times, to ignore the duplicates filter. Use it with care, or you will get into crawling loops. Default to?False.
errback?(callable)如果出现错误则调用函数a function that will be called if any exception was raised while processing the request. This includes pages that failed with 404 HTTP errors and such. It receives a?Twisted Failure?instance as first parameter. For more information, see?Using errbacks to catch exceptions in request processing?below.
flags?(list)给请求贴的标签Flags sent to the request, can be used for logging or similar purposes.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值