vendredi 27 septembre 2019

How can I make a powershell script click on or fill an element without a name or and id?

I'm trying to write a powershell script for loggin in automatically on a website (in IE) and managed to fill the user name value based on it's ID but the password field and the login button have no ID at all. Password field has a name but I can't find a way to use that and login button doesn't even have a name on the website.

User name field:

As you can see the User name field has an actual ID so it's easy to do. But...

Password field:

I'm trying to fill it like this: $ie.Document.getElementByID('password field ID...').value = 'myPassword'

Login button:

I'm trying to click on it like this: $link=$ie.Document.getElementByID('login button ID...') $link.click()

Since none of these elements have an ID, that one won't work. Do you have any suggestions?




Aucun commentaire:

Enregistrer un commentaire