作者:司文龙2502933797 | 来源:互联网 | 2023-09-16 19:39
importrequestsimporttimefromread_ip_poolimportread_ip_poolPROXIES_URL''defget_ip
import requests
import time
from read_ip_pool import read_ip_pool
PROXIES_URL = ''
def get_ip_pool(url=PROXIES_URL):
""" 根据URL构造代理池
:param PROXIES_URL:
:return: []
"""
respOnse= requests.get(url)
with open('IP_POOL', 'w') as f:
f.write(response.text)
print('get_ip_pool is done')
# Unix, 后台运行脚本: &
while True:
get_ip_pool()
read_ip_pool()
# time+死循环, 实现定时功能。
time.sleep(10)
print("")