鱼C论坛

 找回密码
 立即注册
查看: 1291|回复: 0

[技术交流] Python 查询电话号码所在地

[复制链接]
发表于 2020-3-30 21:58:58 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
Python 查询电话号码所在地


  1. from requests import get
  2. from bs4 import BeautifulSoup as BS

  3. def open_url(url):
  4.     res = get(url)
  5.     return res

  6. def check(res):
  7.     soup = BS(res.text, "html.parser")
  8.     target = soup.find("title")
  9.     for each in target:
  10.         print(each)

  11. def main():
  12.     phone = input("请输入电话号码:")
  13.     url = 'https://shouji.51240.com/%s__shouji/' % phone
  14.     res = open_url(url)
  15.     check(res)

  16. if __name__ == "__main__":
  17.     main()
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-4-17 10:39

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表