python - How to find element iframe by attribute src containing specific text -


what best way find element iframe attribute src containing text about . html code

<iframe id="fancybox-frame1464160624818"      name="fancybox-frame1464160624818"      class="fancybox-iframe"      allowfullscreen=""      scrolling="auto"      src="about.jsp?fancybox=true"> </iframe> 

locating id, name, class name not relevant.

i can find iframes in page tag name iframe , check src attribute get_attribute method find iframe unique src attribute.

is possible ?

use xpath. believe expression this

driver.find_element_by_xpath("//iframe[contains(@src,'about'])]") 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -