lundi 3 décembre 2018

Click on button wich changes its id everytime SELENIUM PYTHON

I work with Python and Selenium. The mission is to click on button with text '+like' or on column 'td' with class='profile-image'. But button hasn't id and it's class 'more-likes' is used in others buttons. Same situation with div with class 'profile-image-button' (div's class id used in others 'divs'). I tried to take id of 'td' :

button = photos.find('td', class_='profile-image')
print(button.get_id)

Output is 'None'

Here is html code of webpage:

<td class="profile-image" id="view-75634"> 
    <div class="profile-image-button"> 
        <span class="more-likes">+like</span>
    </div>  
</td>

How can I click on button or how can I take id?




Aucun commentaire:

Enregistrer un commentaire