教程 > scrapy 教程 > 阅读:11

scrapy 其他设置——迹忆客-ag捕鱼王app官网

下表是scrapy的其他设置

序号 设置 描述
1 ajaxcrawl_enabled 它用于启用大型爬网。
默认值: false
2 autothrottle_debug 它可以实时查看节流参数是如何调整的,它会显示每个收到的响应的统计信息。
默认值: false
3 autothrottle_enabled 它用于启用 autothrottle 扩展。
默认值: false
4 autothrottle_max_delay 它用于设置在高延迟情况下下载的最大延迟。
默认值: 60.0
5 autothrottle_start_delay 它用于设置下载的初始延迟。
默认值: 5.0
6 autothrottle_target_concurrency 它定义了 scapy 并行发送到远程站点的平均请求数。
默认值: 1.0
7 closespider_errorcount 它定义了在蜘蛛关闭之前应该接收到的错误总数。
默认值: 0
8 closespider_itemcount 它定义了关闭蜘蛛之前的项目总数。
默认值: 0
9 closespider_pagecount 它定义了蜘蛛关闭前要抓取的最大响应数。
默认值: 0
10 closespider_timeout 它定义了蜘蛛关闭的时间量(以秒为单位)。
默认值: 0
11 commands_module 当我们想在项目中添加自定义命令时使用它。
默认值: ''
12 compression_enabled 它表示启用了压缩中间件。
默认值: true
13 cookies_debug 如果设置为 true,则会记录请求中发送和响应中接收的所有 cookie。
默认值: false
14 cookies_enabled 它表示 cookies 中间件已启用并发送到 web 服务器。
默认值: true
15 files_expires 它定义了文件过期的延迟。
默认值: 90 days
16 files_result_field 当我们想为已处理的文件使用其他字段名称时设置它。
17 files_store 它用于通过将其设置为有效值来存储下载的文件。
18 files_store_s3_acl 它用于修改存储在 amazon s3 存储桶中的文件的 acl 策略。
默认值: private
19 files_urls_field 当我们想要为自己的文件 url 使用其他字段名称时设置它。
20 httpcache_always_store 如果启用此设置,spider 将彻底缓存页面。
默认值: false
21 httpcache_dbm_module 它是用于 dbm 存储后端的数据库模块。
默认值: 'anydbm'
22 httpcache_dir 它是用于启用和存储 http 缓存的目录。
默认值: 'httpcache'
23 httpcache_enabled 它表示已启用 http 缓存。
默认值: false
24 httpcache_expiration_secs 用于设置http缓存的过期时间。
默认值: 0
25 httpcache_gzip 此设置如果设置为 true,所有缓存数据将使用 gzip 压缩。
默认值: false
26 httpcache_ignore_http_codes 它声明 http 响应不应与 http 代码一起缓存。
默认值: []
27 httpcache_ignore_missing 如果启用此设置,则如果在缓存中找不到请求将被忽略。
默认值: false
28 httpcache_ignore_response_cache_controls 它是一个包含要忽略的缓存控件的列表。
默认值: []
29 httpcache_ignore_scheme 它声明 http 响应不应与 uri 方案一起缓存。
默认值: ['file']
30 httpcache_policy 它定义了一个实现缓存策略的类。
默认值: 'scrapy.extensions.httpcache.dummypolicy'
31 httpcache_storage 它是一个实现缓存存储的类。
默认值: 'scrapy.extensions.httpcache.filesystemcachestorage'
32 httperror_allowed_codes 它是一个列表,其中所有响应都以非 200 状态代码传递。
默认值: []
33 httperror_allow_all 启用此设置后,无论其状态代码如何,所有响应都会通过。
默认值: false
34 httpproxy_auth_encoding 它用于对 httpproxymiddleware 上的代理进行身份验证。
默认值: "latin-1"
35 images_expires 它定义图像过期的延迟。
默认值: 90 days
36 images_min_height 它用于使用最小尺寸丢弃太小的图像。
37 images_min_width 它用于使用最小尺寸丢弃太小的图像。
38 images_result_field 当我们要为已处理的图像使用其他字段名称时设置它。
39 images_store 它用于通过将其设置为有效值来存储下载的图像。
40 images_store_s3_acl 它用于修改存储在 amazon s3 存储桶中的图像的 acl 策略。
默认值: private
41 images_thumbs 它被设置为创建下载图像的缩略图。
42 images_urls_field 当我们想为图像 url 使用其他字段名称时设置它。
43 mail_from 发件人使用此设置发送电子邮件。
默认值: 'scrapy@localhost'
44 mail_host 它是用于发送电子邮件的 smtp 主机。
默认值: 'localhost'
45 mail_pass 它是用于验证 smtp 的密码。
默认值: none
46 mail_port 它是用于发送电子邮件的 smtp 端口。
默认值: 25
47 mail_ssl 用于实现使用ssl加密连接的连接。
默认值: false
48 mail_tls 启用后,它会强制使用 starttls 进行连接。
默认值: false
49 mail_user 它定义了一个用户来验证 smtp。
默认值: none
50 metarefresh_enabled 它表示启用了元刷新中间件。
默认值: true
51 metarefresh_maxdelay 这是元刷新重定向的最大延迟。
默认值: 100
52 redirect_enabled 它表示启用了重定向中间件。
默认值: true
53 redirect_max_times 它定义了请求重定向的最大次数。
默认值: 20
54 referer_enabled 它表示 referrer 中间件已启用。
默认值: true
55 retry_enabled 它表示重试中间件已启用。
默认值: true
56 retry_http_codes 它定义要重试哪些 http 代码。
默认值: [500, 502, 503, 504, 408]
57 retry_times 它定义了重试的最大次数。
默认值: 2
58 telnetconsole_host 它定义了 telnet 控制台必须侦听的接口。
默认值: '127.0.0.1'
59 telnetconsole_port 它定义了一个用于 telnet 控制台的端口。
默认值: [6023, 6073]

查看笔记

扫码一下
查看教程更方便
网站地图