Last active
August 29, 2015 14:12
-
-
Save brizzbane/5d275c46122cfa53cb8c to your computer and use it in GitHub Desktop.
phantomjs/ghostdriver session test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
proxylist = ['127.0.0.1','127.0.0.2'] | |
a = {} | |
for proxy in proxylist: | |
a[proxy] = webdriver.PhantomJS(executable_path='C:\Python27\selenium\phantomjs.exe',service_args=['--proxy=' + proxy + ':3128', '--proxy-type=http']) | |
a[proxy].set_window_size(1120, 550) | |
a[proxy].get("http://whatismyipaddress.com") | |
a[proxy].save_screenshot(proxy + '.png') #will always end up displaying 127.0.0.1 in screenshot, while creating both 127.0.0.1.png, and 127.0.0.2.png | |
print a[proxy].current_url | |
a[proxy].quit() | |
print a[proxy] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment