This proxy is split into four parts separated by colons. We first save the proxy as a string variable, then split it into four parts at each colon (:) and then add it, with authentication, to our proxy dictionary.
This proxy is split into four parts separated by colons. We first save the proxy as a string variable, then split it into four parts at each colon (:) and then using the ProxyManager function in urllib3 we add and authenticate the proxy.
from urllib3 import ProxyManager, make_headersproxy_string="residential.pingproxies.com:7777:customer-tt_pp_lz_5051-sessid-Z9tCGVYHu:23n22mk22"proxy_parts = proxy_string.split(":")ip_address = proxy_parts[0]port = proxy_parts[1]username = proxy_parts[2]password = proxy_parts[3]default_headers =make_headers(proxy_basic_auth='{}:{}'.format(username,password))http =ProxyManager("http://{}:{}/".format(ip_address,port), proxy_headers=default_headers)# Now you can use `http` as you would a normal PoolManagerr = http.request('GET', 'https://www.google.com/')