我想將網路書的所有部分收集到一個 HTML 檔案中,以便以后使用 calibre 將其轉換為 ePUB(電子書)。
這是網路書。在網路上,它被組織成很多部分。到目前為止,我一直在使用 chrome devtools 復制粘貼相關的 HTML 部分,以將其組織到一個 HTML 檔案中。我認為在python(或任何其他方式)中可能有更好的方法。
uj5u.com熱心網友回復:
您可以使用這個Python 庫來決議和獲取來自任何網站的 html 代碼,如下所示:
from bs4 import BeautifulSoup
import requests
html = requests.get('https://www.wisdomlib.org/hinduism/book/a-history-of-indian-philosophy-volume-2')
soup = BeautifulSoup(html.content, "html.parser")
element = soup.find("a")
source = element.prettify()
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/455046.html
上一篇:使用美麗的湯從廣告牌前100名網站檢索藝術家姓名時遇到問題
下一篇:我想找到一個四舍五入的方程的值
