0
I’m trying to create a userscript for me to enter my password instead of clicking on the numeric keyboard that the site requires.
The problem is that each button corresponds to 2 random numbers, so I need to make the function identify the number within the Title attribute of one of the buttons.
For example this is the keyboard that just appeared:
<img src="/V1/ITAUF/IMG/teclado_tecla.gif" border="0" width="46" height="46" alt="" title="0 ou 2">
<img src="/V1/ITAUF/IMG/teclado_tecla.gif" border="0" width="46" height="46" alt="" title="1 ou 3">
<img src="/V1/ITAUF/IMG/teclado_tecla.gif" border="0" width="46" height="46" alt="" title="4 ou 6">
<img src="/V1/ITAUF/IMG/teclado_tecla.gif" border="0" width="46" height="46" alt="" title="8 ou 9">
<img src="/V1/ITAUF/IMG/teclado_tecla.gif" border="0" width="46" height="46" alt="" title="5 ou 7">
So assuming my password is 5821 first I would separate each character from the password I typed:
var senha = prompt("Digite sua senha de Internet");
var t = senha.length;
var i = 0;
So now that I need to find out which button corresponds to the character to click it, I thought of something with regular expressions:
while (i < t){
l = senha.substr(i,1);
$('img[title="[i]"]').click(); //Clica no botão que foi encontrado o caractere pela expressão regular
i++;
}
But I didn’t succeed, I’m a little lost in how I can get someone to give me a hint?
grateful.
Thanks the idea is right there, but the bank site has some lock that does not let the userscript work right, so in the end will not work so.
– Daniel Plácido