When trying to do a try and except part in my code y get this error
local variable 'archivo' referenced before assignment
The code is the following:
archivo=open(os.getcwd()+"/proxies.txt",'r')
def get_data(url):
try:
separados=archivo[0].split(":")
datos_proxy="socks5://"+separados[2]+":"+separados[3]+":"+separados[0]+":"+separados[1]
proxy={"sock5": datos_proxy}
r = s.get(url,proxies=proxy)
r.html.render(sleep=3)
links=r.html.absolute_links
for link in links:
if "0x" in link:
if "assets" in link:
if "matic" not in link:
hook.send(link)
except:
archivo=archivo[1:]
Gives me the error in the "separadores" variable.