Encountering difficulties extracting audio from the webpage

Attempting to extract audio(under experience the sound) from 'https://www.akrapovic.com/en/car/product/16722/Ferrari/488-GTB-488-Spider/Slip-On-Line-Titanium?brandId=20&modelId=785&yearId=5447'. The code I have written is resulting in an error.

driver.get('https://www.akrapovic.com/en/car/product/16722/Ferrari/488-GTB-488-Spider/Slip-On-Line-Titanium?brandId=20&modelId=785&yearId=5447')
audio_link = driver.find_element(By.XPATH,'//*[@class="container-xl"]')
print(audio_link.find_element(By.CSS_SELECTOR,'audio'))     

Looking for a more efficient method to scrape it.

Answer №1

One easy way to do it is by utilizing

driver.find_element(By.XPATH,'//audio')

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to determine the number of rows that appear only once in a DataFrame?

I want to find the count of rows in a DataFrame that occur only once. In this scenario, based on the example provided below, the answer would be 2 as only row indexes 2 and 3 appear once: In [1]: df = pd.DataFrame({'a': [1, 1, 2, 3], 'b&apo ...

Accessing the web page using a login prompt with the help of Selenium and

I am having difficulty mapping the elements of the prompt because I cannot inspect them to obtain the ID or name of the login and password fields. I have attempted to use the code below, including giving a tab in the elements, but unfortunately, it has not ...

Resolving a tangled web of interdependencies

a.py: def create_object_a(name): return "A" def execute(): a = create_object_a("A") from b import create_object_b friend_of_a = create_object_b("B") print(a) print(friend_of_a) b.py: def create_object_b(name): return "B" d ...

Creating a list containing key-value pairs from a dictionary in Python

Looking for assistance on how to create a list with two indexes: The key and the corresponding value of a randomly chosen dictionary pair. Here is what I have tried using Latin words: d = {} d['house'] = "domus, domus" data1 = d.items() data = r ...

The Keras Tokenizer seems to be tokenizing just the initial row in the CSV file

I'm fairly new to working with the keras API and have encountered a challenge that I hope someone can help me out with. My dataset is stored in a csv file with 4 columns, but for now, I only need to focus on one specific column - 'host'. I&a ...

Obtaining fresh data with Peewee and Flask only upon restarting

I'm encountering a peculiar issue with my Flask + Peewee application. I have a web app that inserts data into a MySQL database. My Flask app also connects to this database using Peewee. The problem arises when I insert data with the web app - subse ...

Tips for breaking a lengthy line with many sets of brackets?

Is there a way to adhere to PEP 8's guideline of limiting lines to 79 characters when dealing with long strings containing multiple bracket pairs? config["network"]["connection"]["client_properties"]["service"] = config["network"]["connection"]["clien ...

Initiate the Selenium server on a CentOS machine

After setting up a VM with centOS, I attempted to launch the selenium server by following the steps outlined in this tutorial. However, when trying to start the selenium server using webdriver-manager start, I encountered the following error: execvp(): No ...

Unable to sort the x-axis in Seaborn/Matplotlib is causing issues

I've been attempting to sort the x-axis ("size") in reverse order using the py.sorted() function. Despite setting "reverse=True", the plot still displays the axis in its normal order. I'm puzzled as to what went wrong... any insights would be gre ...

Tips on obtaining the regex match without receiving a None value

Looking for a way to use Regex for pattern matching? Let's consider the following scenario: listStrings2 = ['abc', 'def', 'ghi'] listSubstrings2 = ['a', 'b', 'e'] In this case, listStrings2 ...

The functionality of the from_logits parameter in the SparseCategoricalCrossEntropy loss function is not behaving as anticipated

Upon my research, I have come to understand that when from_logits=True, the output is not normalized (not a probability distribution), and when from_logits=False, it is normalized by the softmax function. So if from_logtis=False, shouldn't it be expec ...

Using c# geckodriver with selenium for Firefox automation

Approximately half a year ago, I stumbled upon some information stating that Firefox 48+ (or perhaps its gecko) does not support Actions. However, when I tried to locate this information again recently to determine whether an upgrade is feasible, I was u ...

Is it possible to repeatedly analyze hundreds of complex JSON files to extract specific key-value pairs and then save the results in a CSV file?

I am currently working on parsing JSON files with a specific structure: {"General info": [ { "section": "stuff", "sub-section": "stuff", "heading": "stuff", &quo ...

Utilizing Python to Locate and Transform XML Processing Instructions

We are in the process of transforming our outdated FrameMaker documents into XML. My current task involves converting the following code snippet: <?FM MARKER [Index] foo, bar ?>` into this structured format: <indexterm> <primary>fo ...

Navigating Chrome and chromedriver directories within Jupyter Notebook with Selenium

Scraping a website with a Python notebook using Jupyter has been quite the challenge due to issues with Chrome and chromedriver location. The struggle is real, especially when working on a Linux WSL in a Windows PC. Despite trying various codes, even Selen ...

Httplib is unable to process requests for a particular domain

I have been working on a script that retrieves the HTTP Headers of various web pages using Python's httplib. However, I encountered an issue with a specific domain (and potentially others), where httplib throws an exception that I cannot seem to unde ...

What are some effective techniques for developing a script to automate a straightforward task with selenium?

Hey there! I'm just starting out on my coding journey and I have a cool project idea. I heard about this guy who wrote a script to send a text to his wife when he was working late, and I want to do something similar. Basically, I need a script that c ...

Element Not Found Error

Can someone help me find the Xpath for the element below? - <ion-button class="ta-btn btn-red ios button button-block button-round button-outline ion-activatable ion-focusable hydrated"expand="block"fill="outline"mode=" ...

Experiencing difficulties accessing my Instagram account through Python's request module

import requests as req url='https://www.instagram.com/accounts/login/' data={'username':'****', 'password':'******'} response=req.post(url, data=data, allow_redirects=True) to_check= response.text if(&apo ...

Using NUnit with the Chrome driver without specifying the path

Currently, I am in the process of developing a Selenium test using Chrome Driver. In order to execute the test on my local machine, I have been running the Chrome Driver by specifying the path on my computer like so: Instance = new ChromeDriver(@"C:\ ...