Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
Protractor scan source code looking for ANY element from Array - like Ruby loop do

I need to scan a page in an infinite loop looking for element of an Array , keep refreshing until found and break. I cannot get it to work in JS

in Ruby my code looked like this ( after page remastering no longer works ) I do't know how to reference page source. I have found browser.isElementPresent(), but I cannot get it to work either.

Every help would be much appreciated. Thanks

    POSTCODES = [' TN1 ',  ' TN2 ', ' TN3 ', ' TN4 ', ' TN10 ',' TN11 ',' TN12 ',
                  ' TN15 ', ' TN17 ',' TN18 ',' TN19 ',' TN23 ',' TN24 ',
                  ' TN25 ', ' TN26 ',' TN27 ',' ME1 ', ' ME2 ', ' ME3 ', ' ME4 ', ' ME5 ',
                  ' ME6 ',  ' ME7 ', ' ME8 ', ' ME9 ', ' ME10 ',' ME11 ',' ME12 ',' ME13 ',
                  ' ME14 ', ' ME15 ',' ME16 ',' ME17 ',' ME18 ',' ME19 ',' ME20 ',' CT1 ',
                  ' CT2 ',  ' CT3 ', ' CT4 ', ' CT21 ']

     loop do
       driver.get "https://..."
       if POSTCODES.any? {|pc| @a = pc if driver.page_source.include?(pc)}
         driver.manage.window.maximize
         break
       end
       sleep rand(0.3...0.51)
     end
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda