Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

61
Vistas
Querying Another Webpage for Data with Javascript? Or Another Language

so I am still a baby programmer so this is a pretty general question and I am looking for starting points, concepts, and directions to look into. I will try and provide concrete examples though.

So I am wondering how one could go about crawling another webpage for data from a webpage you made.

As a concrete example, we can use lottery result webpages ... So I live in Ontario, and our big lottery here is Lotto Max ... the official results page is https://www.olg.ca/en/lottery/play-lotto-max-encore/about.html ...

So let's say you were making a website that shows lotto results ... so we know the link above ... and if you inspect you can find the elements which contain those ... if you inspect and follow through in the correct section you eventually get into the divs with a class name "lotto-ball-large selected lotto-ball" and within those there is a div with class name "ball-number". There's also the div with a class name "lotto-ball-large special-ball-lmax selected lotto-ball" and within that there is an eighth and final div with class name "ball-number" for the bonus number. And these are of course just sorted in ascending order with the bonus ball at the end.

So at this point, we know the actual website link we would need to query ... we also know the divs we need to query for the winning numbers ... also the corresponding div for the date and whatnot ...

My question is what are methodologies or functions in javascript for doing this? Especially en masse with large sets of data. Like once you identify the location and the classes or IDs of data you want to pull, what are good methodologies or functions in javascript or other languages for doing so.

Thank you.

7 months 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 empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.