How to extract phonetic language from the web with Python

21 Views Asked by At

I'm trying to extract the phonetic spelling of a web dictionary entry. Specifically, this dictionary AVL-DNV

Is there any way of working with phonetic language in Python and extracting the phonetic spelling from a web? My goal would be to extract something like this [peɾɔ́l].

1

There are 1 best solutions below

0
Andrej Kesely On

For extracting things from HTML documents you can use . For example:

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])

Prints:

[peɾɔ́l]