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’ : [] })

发表评论

您的电子邮箱地址不会被公开。