Using proxy(private) in PhantomJs with python
<p>I am using a private poxy IP with PhatomJS and Python, My code below</p>

<pre><code>phantomjs_path = r"phantomjs.exe"
service_args = [
    '--proxy=MY Private IP',
    '--proxy-type=socks5',
    '--proxy-auth=username:password', # I enter real user name and pass here
    ]

browser = webdriver.PhantomJS(executable_path=phantomjs_path,service_args=service_args)
browser.get("Any website") # I use any website unblocked on that I.P
print(browser.page_source)
</code></pre>

<p>when I run the bot and I am trying to get the page source</p>

<p>But the output for any page is this why?</p>

<pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;
</code></pre>

<p>There is no error message shown I don't know what I have missed here?</p>

<p>Also tested with sleep function(I thought the page took some time to load)</p>

<p>The port number needs to be added here,</p>

<pre><code>service_args = [
'--proxy=MY Private IP:port',  # See the difference
'--proxy-type=socks5',
'--proxy-auth=username:password', # I enter real user name and pass here
]
</code></pre>

python selenium phantomjs