【发布时间】:2023-01-09 01:38:14
【问题描述】:
有这段代码
import requests
from bs4 import BeautifulSoup
ports_url = 'http://spys.one/proxy-port/'
headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0'}
soup = BeautifulSoup(requests.post(ports_url, headers=headers, data={'xpp': 5}).content, 'html.parser')
for f in soup.select('td[colspan="2"] > a > font.spy6'):
u = 'http://spys.one/proxy-port/' + f.text + '/'
s = BeautifulSoup(requests.post(u, headers=headers, data={'xpp': 5}).content, 'html.parser')
for ff in s.select('tr > td:nth-child(1) > font.spy14'):
print(ff.text)
有必要将 ip=ip : port=port 保存到 txt 文件或 db 请帮帮我
【问题讨论】:
标签: linux ubuntu python parsing