from requests import get
from bs4 import BeautifulSoup as BS
def open_url(url):
res = get(url)
return res
def check(res):
soup = BS(res.text, "html.parser")
target = soup.find("title")
for each in target:
print(each)
def main():
phone = input("请输入电话号码:")
url = 'https://shouji.51240.com/%s__shouji/' % phone
res = open_url(url)
check(res)
if __name__ == "__main__":
main()