I'm trying to create a userscript for myself by typing in my password instead of clicking on the numeric keypad that the site requires.
The problem is that each button corresponds to 2 random numbers, so I need to have the function identify the number within the Title attribute of one of the buttons.
For example this is the keyboard that has now 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;
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 did not succeed, I'm kind of lost in how can I make someone give me a tip?
grateful.