I am trying to use a proxy server but when i run the following code i am seeing my lan ip address as an output even if i am explicity using another proxy address taken from this site https://free-proxy-list.net/ I am learning so if anyone could help me thank it would be great. Below is the full code :
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
import time
PROXY="159.203.61.169:8080"
opts = Options()
user_agent = 'Mozilla/5.0 CK={} (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko'
webdriver.DesiredCapabilities.CHROME['proxy'] = {
"httpProxy": PROXY,
"ftpProxy": PROXY,
"sslProxy": PROXY,
"proxyType": "MANUAL",
}
webdriver.DesiredCapabilities.CHROME['acceptSslCerts']=True
opts.add_argument("user-agent="+user_agent)
print(webdriver.DesiredCapabilities.CHROME)
driver =webdriver.Chrome(options=opts)
driver.get('https://httpbin.io/ip')
# get proxy value element
ip = driver.find_element(By.TAG_NAME, 'body').text
# print the current IP address
print(ip)