码迷,mamicode.com
首页 > 其他好文 > 详细

scrapy中的ruquest

时间:2017-11-24 17:06:27      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:sel   lag   color   one   without   ict   back   flags   nbsp   

1. scrapy.Request 对象 和 requests.get()

 1 class Request(object_ref):
 2 
 3     def __init__(self, url, callback=None, method=GET, headers=None, body=None,
 4                  cookies=None, meta=None, encoding=utf-8, priority=0,
 5                  dont_filter=False, errback=None, flags=None):
 6 
 7         self._encoding = encoding  # this one has to be set first
 8         self.method = str(method).upper()
 9         self._set_url(url)
10         self._set_body(body)
11         assert isinstance(priority, int), "Request priority not an integer: %r" % priority
12         self.priority = priority
13 
14         assert callback or not errback, "Cannot use errback without a callback"
15         self.callback = callback
16         self.errback = errback
17 
18         self.cookies = cookies or {}
19         self.headers = Headers(headers or {}, encoding=encoding)
20         self.dont_filter = dont_filter
21 
22         self._meta = dict(meta) if meta else None
23         self.flags = [] if flags is None else list(flags)

 

scrapy中的ruquest

标签:sel   lag   color   one   without   ict   back   flags   nbsp   

原文地址:http://www.cnblogs.com/liyugeng/p/7890974.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!