BlueGreenWhyteRed
BlueGreenWhyteRed

Reputation: 3

Selenium unable to find DOM node index element on webpage

My goal is to scrape the src link within the video tag on this webpage. This is where I am seeing the video tag along with the link which I want.

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

Upvotes: 0

Views: 141

Answers (1)

Barry the Platipus
Barry the Platipus

Reputation: 10460

You can get the source attribute with:

[...]
source = driver.find_element(By.XPATH, '//video').get_attribute('src')
print(source)
[...]

Result in terminal:

blob:https://mplayer.me/d420cb30-ed6e-4772-b169-ed33a5d3ee9f

See Selenium documentation at https://www.selenium.dev/documentation/

Upvotes: 1

Related Questions