Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
javascript: var search='dominio.com'; var items=document.getElementsByClassName('g'); var position=0; var found=false; var texto; var i=0; var total=items.length; while(!found && i<total){ texto=items[i].innerText; if( items[i].tagName == 'DIV' && !items[i].id ){ position++; if( texto.indexOf(search) > -1 ){ found = position+'- '+texto; };};i++;}; if(!found){ found='No se ha encontrado' }; alert(found);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.