Jan-19-2021, 09:38 AM
(Jan-19-2021, 09:32 AM)buran Wrote:(Jan-19-2021, 09:16 AM)rizzla Wrote: and how do i use both, HTTP and HTTPs proxies? cause its a mix of themdefine bothhttp
andhttps
schema inproxies
dict. As I said, I think because your url ishttps
and you provide only proxy forhttp
schema it uses system defaults
so whats happening is that i have another piece of code at the bottom which is scrapping proxies from another site. and then appending to a list object called
proxy
. now these proxies are a mix of http and https.i tried changing that part to this:
but now since i changed the method to `https` it dosent print anything. im not sure why this problem arised tho. import requests from bs4 import BeautifulSoup as bs import concurrent.futures from colorama import Fore proxy = [] fproxy = [] def check_proxies_def(): print('[#] Checking proxies now ') def check_proxies(proxy): try: r = requests.get('https://www.epicgames.com/id/api/account/name/state/test', proxies={'https':proxy}, timeout=3) if r.status_code == 200: fproxy.append(proxy) print(Fore.GREEN + 'Working proxy --> ', proxy) else: print(Fore.RED + 'Not working proxy --> ', proxy) pass except TimeoutError: pass except ConnectionError: pass def proxies(proxy): with concurrent.futures.ThreadPoolExecutor(max_workers=30) as executor: executor.map(check_proxies, proxy) proxies(proxy)