Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

332
Views
Extract audio URL (mp3) from web player using Python

I am trying to extract URL link from webpage so I could download the audio as mp3, but still unsuccess... Here is a webpage code:

webpage code

I would like to grab a value of 'scr' attribute: 'https://radio-arch-pp.stv.livebox.sk/a520/00/0024/002424/00242487-1.mp3'

None of these attempts prints that value:

1)

import requests
from bs4 import BeautifulSoup

re  = requests.get("https://www.rtvs.sk/embed/audio/242500")
soup = BeautifulSoup(re.text, 'html.parser')

result = soup.findAll("div", id="player_audio_242500")
print(result)

for n in soup.findAll("div", id="player_audio_242500"):
    if 'src' in n.attrs:
        result = n['src']
    else:
        result = n.text
    print(result)

for n in soup.find_all('script'):
    print(n.get('src'))

for n in soup.find_all('script'):
    if 'src' in n.attrs:
        result = n['src']
    else:
        result = n.text
    print(result)
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.service import Service

ser = Service("chromedriver")
op = webdriver.ChromeOptions()
chrome_browser = webdriver.Chrome(service=ser, options=op)
chrome_browser.maximize_window()
chrome_browser.get('https://www.rtvs.sk/embed/audio/242500')

enter = chrome_browser.find_element(by=By.CSS_SELECTOR, value="[id^=player_audio]")
print(enter)
print(enter.text)

Can anybody help please?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Take a look at your css selector, it should select the video and should take its src attribute like that:

chrome_browser.find_element(By.CSS_SELECTOR, 'video').get_attribute("src")
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!