python selenium PhantomJS 动态设置代理IP

 

from selenium import webdriver
driver = webdriver.PhantomJS()
driver.command_executor._commands[‘executePhantomScript’] = (‘POST’, ‘/session/$sessionId/phantom/execute’)
driver.execute(‘executePhantomScript’, {‘script’: ”’phantom.setProxy("10.0.0.1", 80);”’, ‘args’ : [] })

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注