>>51
import requests
from bs4 import BeautifulSoup
from collections import Counter
import re
url = 'http://sora.5ch.net/test/read.cgi/livewkwest/1682995921/'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
ids = []
for tag in soup.find_all(string=re.compile('ID:')):
id = tag.split('ID:')[1].strip()[:8]
ids.append(id)
counted_ids = Counter(ids)
for i, (id, count) in enumerate(counted_ids.most_common(), 1):
print(f'{i}位:ID:{id} {count}')
print(f'前スレ参加者{i}人')