python 網頁文字提取

zsdeus133發表於2018-07-25

提取網頁指定內容用的

import requests
from bs4 import BeautifulSoup
import re

url = "https://xxxxxx.html"
html = requests.get(url).text

bs = BeautifulSoup(html)

users = bs.select('.c-author')
for each in users:
    print(each.text)

相關文章