gpt4 book ai didi

python - scrapy 允许所有域

转载 作者:太空狗 更新时间:2023-10-29 21:22:50 26 4
gpt4 key购买 nike

我看到了this发布使 scrapy 抓取任何站点而不受允许的域限制。

有没有更好的方法,比如在允许的域变量中使用正则表达式,比如-

allowed_domains = ["*"]

我希望除了侵入 scrapy 框架之外还有其他方法来做到这一点。

最佳答案

根本不要设置 allowed_domains。

查看这个 scrapy 文件中的 get_host_regex() 函数:

https://github.com/scrapy/scrapy/blob/master/scrapy/contrib/spidermiddleware/offsite.py

关于python - scrapy 允许所有域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9543292/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com