CeBiDeX CeBiDeX - 7 months ago 8
Python Question

How can i read this src text with selenium in python?

<iframe id="frameNewAnimeuploads0" src="http://www.watchcartoononline.com/inc/animeuploads/embed.php?file=rick%20and%20morty%2FRick.and.Morty.S02E10.The.Wedding.Squanchers.720p.WEB-DL.DD5.1.flv&amp;hd=1" width="530" height="410" frameborder="0" scrolling="no" allowfullscreen=""></iframe>


I want to read src text.
(http://www.watchcartoononline.com/inc/animeuploads/embed.php?file=rick%20and%20morty%2FRick.and.Morty.S02E10.The.Wedding.Squanchers.720p.WEB-DL.DD5.1.flv&hd=1)

How can i read this ?

Answer

This is how you can do it. Firs you need to identify the frame which is a WebElement and then you can get its Attribute using getAttribute method.

frame = driver.find_element_by_id('frameNewAnimeuploads0')
frame.get_attribute("src")

Hope it helps!

Comments