Using Selenium, PhantomJS and Tor in python
This is an old one, but I came here, because I searched for exactly what you wanted to do.
When I executed your code, I got exactly the same behaviour.
Simply remove the blank space at second argument ('--proxy-type=socks5') and your code is working nicely.
Thus,
from selenium import webdriver service_args = [ '--proxy=127.0.0.1:9050', '--proxy-type=socks5', ] driver = webdriver.PhantomJS(service_args = service_args)