以下のXMLコードでrect ID値を検索しようとしていますが、空リストとして取得しようとしています。これについてのどんな助けもありがとう!!!!! > driver.find_elements_by_xpathを( "/働い -Python Selenium Webdriverを使用してSVG要素を見つけることができません
driver.find_element_by_xpath( "//オブジェクト[ID @ = 'nodia']"):クロムとFirefoxの両方で全て以下Possibiltiesが試さ
<object id="nodia"
< svg id="svg2" xmlns:svg='http://www.w3.org/2000/svg'>
< g id="layer1>
<image id="image3022"></image>
<rect id="rect8696"></rect>
<rect id="rect8996-6" ></rect>
</g>
</svg>
</object>
/[ローカル名()= 'svg'とnamespace-uri()= 'http://www.w3.org/2000/svg'] ") - >空リストを返します driver.find_elements_by_xpath(" // [local-name()= 'svg' ] ") - >返す driver.find_elements_by_xpath(" //オブジェクト[@ id = 'nodia']/svg ") - >空リストを返します
driver.find_elements_by_xpath(「ID( 'svg2')// * [名:
またはCSSセレクタと
()= 'rect'] ")は、rectのid値ではなく空のリストを返します。これで助けてください! –