Update collect_ips.py

This commit is contained in:
jc-lw 2024-10-20 16:42:59 +08:00 committed by GitHub
parent d3227f8a36
commit 69d7e0a487
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4,7 +4,7 @@ import re
import os
# 目标URL列表
urls = ['https://cf.090227.xyz',
urls = ['https://ip.164746.xyz/ipTop10.html',
'https://ip.164746.xyz'
]
@ -25,7 +25,7 @@ with open('ip.txt', 'w') as file:
soup = BeautifulSoup(response.text, 'html.parser')
# 根据网站的不同结构找到包含IP地址的元素
if url == 'https://cf.090227.xyz':
if url == 'https://ip.164746.xyz/ipTop10.html':
elements = soup.find_all('tr')
elif url == 'https://ip.164746.xyz':
elements = soup.find_all('tr')