Home >Backend Development >Python Tutorial >How to click on first email in gmail inbox in Seleniumbase?

How to click on first email in gmail inbox in Seleniumbase?

WBOY
WBOYforward
2024-02-08 21:10:54980browse

如何在 Seleniumbase 中点击 gmail 收件箱中的第一封电子邮件?

Question content

I am trying to get the id from the html in order to pass it like xpath, but the id is not the same as in chrome

Absolute path is not suitable as it will always be different. Please help:(


Correct answer


As far as I know, there is only one f5d188ed2c074f8b944552db028f98a1 element that has the following xpath and that particular element Which happens to be the element that contains all email elements:

//table[@role='grid']

So to click on the first element I will use the following xpath:

//table[@role='grid']//tr[1]

There may be issues depending on where exactly in the row the click occurs, but I suspect it will fail.

The above is the detailed content of How to click on first email in gmail inbox in Seleniumbase?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete