时隔五年,Scrapyd 终于原生支持 basic auth

栏目: Python · 发布时间: 6年前

Issue in 2014

scrapy/scrapyd/issues/43

时隔五年,Scrapyd 终于原生支持 basic auth

Pull request in 2019

scrapy/scrapyd/pull/326

时隔五年,Scrapyd 终于原生支持 basic auth

试用

  1. 安装: pip install -U git+https://github.com/my8100/scrapyd.git@add_basic_auth
  2. 更新配置文件 scrapyd.conf ,其余配置项详见 官方文档
[scrapyd]
username = yourusername
password = yourpassword
  1. 启动: scrapyd
In [1]: import requests

In [2]: requests.get('http://127.0.0.1:6800/').status_code
Out[2]: 401

In [3]: requests.get('http://127.0.0.1:6800/', auth=('admin', 'admin')).status_code
Out[3]: 401

In [4]: requests.get('http://127.0.0.1:6800/', auth=('yourusername', 'yourpassword')).status_code
Out[4]: 200
  1. 由于 Scrapyd 的 GitHub 最新提交已经 重构了 Jobs 页面 ,如果正在使用 ScrapydWeb 管理 Scrapyd,则需同步更新 ScrapydWeb: pip install -U git+https://github.com/my8100/scrapydweb.git

GitHub

my8100/scrapyd


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

High Performance Python

High Performance Python

Andrew Lewis / O'Reilly Media, Inc. / 2010-09-15 / USD 34.99

Chapter 1. Introduction Section 1.1. The High Performance Buzz-word Chapter 2. The Theory of Computation Section 2.1. Introduction Section 2.2. Problems Section 2.3. Models of Computati......一起来看看 《High Performance Python》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试