close

import requests
from bs4 import BeautifulSoup

res=requests.get('https://www.ptt.cc/bbs/joke/index.html')
soup=BeautifulSoup(res.text,'lxml')


for item in soup.select('.r-ent'):
    print(item.select('.title')[0].text,item.select('.date')[0].text,item.select('.author')[0].text)       標題/日期/作者

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 阿亮 的頭像
    阿亮

    阿喨的部落格

    阿亮 發表在 痞客邦 留言(0) 人氣()