def get_api_iplist():
f_ua = fake.user_agent()
# url = "https://www.baidu.com/" # 测试网站url地址
url = "http://api.89ip.cn/tqdl.html?api=1&num=600&port=&address=&isp=" # 测试网站url地址
headers = {'User-Agent': f_ua} # 请求头
# proxies = {
# 'https': random.choice(iplist),
# }
# html = requests.get(url=url, headers=headers, proxies=proxies).text # 获取响应内容
html = requests.get(url=url, headers=headers).text # 获取响应内容
iplist1 = re_method(html,"<br>","<br>")
# print(len(iplist1))
#使用方式可以如下
#proxies = {标签:get,url,ip,html,拿到,headers,api,proxies From: https://www.cnblogs.com/Lhptest/p/18220251
'http': 'http://' + random.choice(get_api_iplist())
}