WebMonitor icon indicating copy to clipboard operation
WebMonitor copied to clipboard

因为众所周知的原因,麻烦给个选项,能够设置代理地址

Open perfy576 opened this issue 4 years ago • 6 comments

抓取 日本亚马逊的时候需要代理。。。 麻烦添加以下功能。

perfy576 avatar Nov 17 '20 23:11 perfy576

我自己魔改了。。。

perfy576 avatar Nov 21 '20 02:11 perfy576

我自己魔改了。。。

可以PR

LogicJake avatar Nov 21 '20 02:11 LogicJake

试试 Docker 容器的启动代理配置?

if1y avatar Dec 07 '20 12:12 if1y

试试 Docker 容器的启动代理配置?

不起作用,无论是config.json还是直接docker run --env都没用。

adrianzhang avatar Oct 16 '21 09:10 adrianzhang

搜索了一下 https://stackoverflow.com/questions/14699718/how-do-i-set-a-proxy-for-phantomjs-ghostdriver-in-python-webdriver

from selenium import webdriver
from selenium.webdriver.phantomjs.service import Service as PhantomJSService

phantomjs_path = '/usr/lib/node_modules/phantomjs/lib/phantom/bin/phantomjs'
# monkey patch Service temporarily to include desired args
class NewService(PhantomJSService):
    def __init__(self, *args, **kwargs):
        service_args = kwargs.setdefault('service_args', [])
        service_args += [
            '--proxy=localhost:8080',
            '--proxy-type=http',
        ]
        super(NewService, self).__init__(*args, **kwargs)
webdriver.phantomjs.webdriver.Service = NewService
# init the webdriver
self.driver = webdriver.PhantomJS(phantomjs_path)
# undo monkey patch
webdriver.phantomjs.webdriver.Service = **PhantomJSService**

但是不知道怎么才能让界面上有这个选项。

adrianzhang avatar Oct 16 '21 10:10 adrianzhang

这个怎么使用?

Dlian-Zero avatar Sep 03 '22 12:09 Dlian-Zero