Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
578 views
in Technique[技术] by (71.8m points)

gmail - How do I find an XPath to match the search field in Google mail web for use in tagui?

How can I automate reading and writing mails in the GMail web client or with a GMail account.

I currently have the following code:

// For this .tag flow to work, please add a file with the name tagui_local.csv.
// In this file, add the following lines:
// OBJECT,DEFINITION
// google_username,[your_google_username]
// google_password,[your_google_password]
// If the file already exists, only add the last 2 lines to it.
// Then, start the flow via console by typing
// cd C:/tagui/flows[enter]
// tagui 2-[tab][enter]

echo Login to `google_username`
wait 1
keyboard [win]r
keyboard chrome.exe[enter]
keyboard [ctrl][shift]n
keyboard https://accounts.google.com[enter]
wait 1

// New Login
keyboard `google_username`
keyboard [enter]
wait 1
keyboard `google_password`
keyboard [enter]
echo Logged in.
wait 1
keyboard [ctrl]t
keyboard https://gmail.com[enter]
wait 3
click (//input[@placeholder="In E-Mails suchen"])

executing this in tagui while in the German version of mail.google.com: click (//input[@placeholder="In E-Mails suchen"])[1]

Gives me: ERROR - cannot find (//input[@placeholder="In E-Mails suchen"])[1]

But the element should be there: enter image description here

This is the result I get when trying to match the XPath in the Chrome console itself: It also doesn't find the element. enter image description here

Do you have an idea how I can match this field? And why is this hidden / anonymous?

Is there any better solution using a local client like Thunderbird and POP3?

Kind regards and thanks,

question from:https://stackoverflow.com/questions/65876304/how-do-i-find-an-xpath-to-match-the-search-field-in-google-mail-web-for-use-in-t

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...