Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
Extract src of <img> element (selected by class) from multiple HTML pages

Example:

website has url https://images.com/Robots.aspx?ID=xxxx , where xxxx is an integer between 1 and 1935.

On each given page there can be an <img class="thumbnail" src="Images\Robots\{robotname}.png">. Not all pages have this element.

I need to extract all existing {robotname} variants and then download the images, but i'm struggling to understand how i can store the element in an object (Python or JS, for example).

How do i start / what i can read to do it?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

In Python you can use BeautifulSoup and extract all img tags soup.find_all("img") and manipulate the data from there

about 4 years ago · Juan Pablo Isaza Relatório

0

  1. Download each page in a loop with AJAX.
  2. Parse the DOM with something like jsdom.
  3. Use a selector with [querySelectorAll()].(https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) to get each image element.
  4. Use a regular expression on the image src-attribute to get the robot name. Like: $img.src.match(/([^\/]+).png$/i)[1].
  5. Download all the robots with AJAX.
  6. Combine robot name and downloaded robot to an object with key value pairs.

Let me know if you need more help or a code example.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda