Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vivirenremoto/fa5dec33846c87ca5e29e8bcd9689a5c to your computer and use it in GitHub Desktop.
Save vivirenremoto/fa5dec33846c87ca5e29e8bcd9689a5c to your computer and use it in GitHub Desktop.
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