Python Forum
Proxy Checking Software Error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Proxy Checking Software Error
#5
(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 them
define both http and https schema in proxies dict. As I said, I think because your url is https and you provide only proxy for http 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)  
Reply


Messages In This Thread
Proxy Checking Software Error - by rizzla - Jan-19-2021, 08:47 AM
RE: Proxy Checking Software Error - by buran - Jan-19-2021, 09:06 AM
RE: Proxy Checking Software Error - by rizzla - Jan-19-2021, 09:16 AM
RE: Proxy Checking Software Error - by buran - Jan-19-2021, 09:32 AM
RE: Proxy Checking Software Error - by rizzla - Jan-19-2021, 09:38 AM
RE: Proxy Checking Software Error - by rizzla - Jan-19-2021, 09:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error while checking for key in Dictionary onenessboy 5 3,939 Aug-14-2020, 01:06 PM
Last Post: onenessboy

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020