Closed wucyAAA closed 4 months ago
with requests.session() as session: while True: try: task = get_task() if task is None: time.sleep(1) continue response = session.get(url, headers=headers, proxies=task['ip'],timeout=6) parse_detail(response .text) except Exception as e: report_data(task['url'], [], task['tid'],False,str(e)) logger.error(e) time.sleep(1) 大概就是这样的结构,只有request操作,是什么地方没写好会造成这样的错误呢?能给点建议吗? 小白第一次提问,可能说的不够清晰,抱歉抱歉
As described in the template, we won't be able to answer questions on this issue tracker. Please use Stack Overflow
with requests.session() as session: while True: try: task = get_task() if task is None: time.sleep(1) continue response = session.get(url, headers=headers, proxies=task['ip'],timeout=6) parse_detail(response .text) except Exception as e: report_data(task['url'], [], task['tid'],False,str(e)) logger.error(e) time.sleep(1) 大概就是这样的结构,只有request操作,是什么地方没写好会造成这样的错误呢?能给点建议吗? 小白第一次提问,可能说的不够清晰,抱歉抱歉