Open Larisa-HSU opened 3 years ago
import requests
from bs4 import BeautifulSoup
choose=requests.get('https://www.ptt.cc/bbs/hotboards.html')##choose為自訂名稱
ffile_PPT = BeautifulSoup(choose.text,"html.parser")##ffile_PPT為自訂名稱
tbody=ffile_PPT.find("body")
div=tbody.find_all("div",{"class":"b-ent"})
for board in div:
name=board.find("div",{"class":"board-name"}).text
num=board.find("div",{"class":"board-nuser"}).text
if int(num)>=1000:
print(name,num)