-2
I’m wanting to get the information from arial-label
, href
and title
tag a
down:
<a aria-label="AS MAIS TOCADAS NO BAILE FUNK 2019 #1 - SET DE FUNK by Funk 24por48 10 months ago 39 minutes 3,186,126 views" class="yt-simple-endpoint style-scope ytd-video-renderer" href="/watch?v=vTakYj4802U" id="video-title" title="AS MAIS TOCADAS NO BAILE FUNK 2019 #1 - SET DE FUNK">
<yt-formatted-string aria-label="AS MAIS TOCADAS NO BAILE FUNK 2019 #1 - SET DE FUNK by Funk 24por48 10 months ago 39 minutes 3,186,126 views" class="style-scope ytd-video-renderer">AS MAIS TOCADAS NO BAILE FUNK 2019 #1 - SET DE FUNK</yt-formatted-string>
</a>
I got this HTML snippet through selenium
and BeautifulSoap
(code down)
self.driver = webdriver.Firefox(options=self.options)
self.driver.get('https://www.youtube.com/results?search_query=funk+baile')
self.html = self.driver.find_elements_by_xpath('//*[@id="contents"]')[0].get_attribute('outerHTML')
self.html_musicas = self.soap.findAll(id="video-title", href=True)
How could I achieve the values of the attributes mentioned above? (arial-label
, href
and title
)