如何使用Python从网络中提取语音语言

问题描述 投票:0回答:1

我正在尝试提取网络词典条目的语音拼写。 具体来说,这本词典AVL-DNV

有没有办法在Python中使用语音语言并从网络中提取语音拼写? 我的目标是提取这样的东西 [peɾɔ́l]。

python web-scraping extract phonetics
1个回答
1
投票

要从 HTML 文档中提取内容,您可以使用 。例如:

import warnings

import requests
from bs4 import BeautifulSoup

warnings.filterwarnings("ignore")

url = "https://www.avl.gva.es/lexicval/?paraula=perol"
soup = BeautifulSoup(requests.get(url).content, "html.parser")

ph = [tag.text for tag in soup.select(".trfonetica")]
print(ph[-1])

打印:

[peɾɔ́l]
© www.soinside.com 2019 - 2024. All rights reserved.