• slider image 221
:::

7-2 爬蟲

爬蟲

import requests
from bs4 import BeautifulSoup
#取得網址
res = requests.get('http://sypswiki.dcs.tn.edu.tw/wiki/index.php?title=Python_%E7%AD%86%E8%A8%98')
soup= BeautifulSoup(res.text,"lxml")
for item in soup.select('.mw-headline'):
    print(item.text)

Google網站翻譯工具列

站內搜尋