Default / 默认 · 8月 31, 2021

slpash启用tor代理

内容纲要

启用docker

bash
sudo docker run -d --name splash -p 8050:8050 -v /mnt/data/proxy:/etc/splash/proxy-profiles -p 5023:5023 scrapinghub/splash --max-timeout 3600

创建一个tor.ini

[proxy]

; required
host=107.12.96.188
port=9050

; optional, default is no auth
;username=username
;password=password

; optional, default is HTTP. Allowed values are HTTP and SOCKS5
type=SOCKS5

;[rules]
; optional, default ".<em>"
;whitelist=
;    .</em>mywebsite.com.*

; optional, default is no blacklist
;blacklist=
;    .<em>.js.</em>
;    .<em>.css.</em>
;    .*.png

只需要在请求参数中加入&proxy=tor 即可。

bash
curl 'http://localhost:8050/render.html?url=http://mywebsite.com/page-with-javascript.html&proxy=mywebsite'

Splash HTTP API – Splash 3.5 documentation

%d 博主赞过: