Answer the question
In order to leave comments, you need to log in
How to get the link from content='link'?
Let's say there is an element:
<meta property="og:audio" content="https://freesound.org/data/previews/611/611605_1648170-lq.mp3" />
https://freesound.org/data/previews/611/611605_1648170-lq.mp3
Answer the question
In order to leave comments, you need to log in
from bs4 import BeautifulSoup
html = '<meta property="og:audio" content="https://freesound.org/data/previews/611/611605_1648170-lq.mp3" />'
soup = BeautifulSoup(html,"lxml")
mp3_url = soup.find('meta',property='og:audio').get('content')
print(mp3_url)
>>> https://freesound.org/data/previews/611/611605_1648170-lq.mp3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question