标签:return 直接 ges head -o http代理 pre beautiful 很多
网络上搜索一下有很多提供HTTP代理的网站,直接使用BeautifulSoup将IP爬下来。
html =requests.get(url).text
bs =BeautifulSoup(html,‘html.perser‘)
#findAll()
#select()
res = requests.get(url,headers=headers,proxies=proxies)
#判断res.status_code是否等于200
#db.insert_one()
如果验证成功写入数据库。
使用fastapi
@app.get(‘/api‘)
def api():
data = 查询数据库随机返回一条
return data
演示地址:找IP
标签:return 直接 ges head -o http代理 pre beautiful 很多
原文地址:https://www.cnblogs.com/aosky/p/14048149.html