Created
December 12, 2021 04:16
-
-
Save Neko288/31ee593ef6c653717bb886b71e592cb4 to your computer and use it in GitHub Desktop.
苗字ランキングを教えるンゴ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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