from bs4 import BeautifulSoup # 原始 HTML 程式碼 html_doc = """
This is a test.
Link 1 Link 2Hello, Bold Text
""" # 以 Beautiful Soup 解析 HTML 程式碼 #url = 'https://dct.ntcu.edu.tw/news.php' soup = BeautifulSoup(html_doc, 'html.parser') print(soup.prettify())