aosky

使用的库

  • bs4
  • requests
  • pymongo
  • fastapi
  • uvicorn

爬取ip

网络上搜索一下有很多提供HTTP代理的网站,直接使用BeautifulSoup将IP爬下来。

html =requests.get(url).text
bs =BeautifulSoup(html,\'html.perser\')
#findAll()
#select()

验证ip

res = requests.get(url,headers=headers,proxies=proxies)
#判断res.status_code是否等于200
#db.insert_one()

如果验证成功写入数据库。

接口

使用fastapi

@app.get(\'/api\')
def api():
	data = 查询数据库随机返回一条
	return data

效果展示

https://998ip.com
https://www.ipzdc.com

演示地址:找IP

分类:

技术点:

相关文章:

  • 2022-01-05
  • 2021-08-07
  • 2021-08-07
  • 2021-12-04
  • 2022-12-23
  • 2022-01-18
猜你喜欢
  • 2021-04-09
  • 2021-08-06
  • 2021-08-19
  • 2021-12-29
  • 2021-12-29
  • 2021-08-07
相关资源
相似解决方案