Skip to content

Instantly share code, notes, and snippets.

@Neko288
Created December 12, 2021 04:16
Show Gist options
  • Save Neko288/31ee593ef6c653717bb886b71e592cb4 to your computer and use it in GitHub Desktop.
Save Neko288/31ee593ef6c653717bb886b71e592cb4 to your computer and use it in GitHub Desktop.
苗字ランキングを教えるンゴ
import requests
from bs4 import BeautifulSoup
import re
print('あなたの苗字のランキングを教えて上げます')
def myoji_rank():
myoji = (input('あなたの苗字 : '))#曲名
res = requests.get('https://myoji-yurai.net/searchResult.htm?myojiKanji=' + myoji)
myoji_soup = BeautifulSoup(res.content, "lxml")
rank = myoji_soup.find('p', style = 'font-size:1.2em;margin-bottom:0;')
print(rank.text + '\n\n' + '-----------------------------------------------------------' + '\n\n')
myoji_rank()
while True:
myoji_rank()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment