scrapy.request

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

参数 说明 describe
url?(string) 需要请求的url the 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) 请求的方法,默认是GET the 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) 请求的cookie the 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) 这个请求的优先级,默认是0 the 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.

你可能感兴趣的:(爬虫)