Selenium Webdriver Python很难找到元素,因为节点id不断变化,并且没有给出太多的els

2024-06-02 09:44:04 发布

您现在位置:Python中文网/ 问答频道 /正文

<div id="node-347146" class="node node-article node-teaser clearfix" about="/books/david-ar-white-chasing-your-god-given-dream" typeof="schema:Article sioc:Item foaf:Document" sliderimagepath="">

<div class="teaser-image">
<a class="clearfix" href="/books/david-ar-white-chasing-your-god-given-dream" style="position:relative;">
<img src='http://www1./sites/default/files/styles/image_xl_640x480/public/media/standard/images/david-ar-white_si.jpg?itok=1ZKuo2_F' alt='' class='img-responsive'> </a> </div>
<div class="teaser-text"><h3><a href="/books/">David A.R. White on Chasing Your God-Given Dream</a></h3></div>
<p>You know him as Pastor Dave from the highly successful movie, God’s Not Dead and its sequel God’s Not Dead 2.&nbsp; With a witty charm powered by the...</p> </div>

我不能使用ID,因为这将改变我只需要找到一致的项目,但我知道文章ID将不断变化


Tags: divnodeyourbooksgivenclassardavid