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

198
Visualizações
Get element in an HTML document within another HTML document

I am trying to write a Chrome extension that can read a url that is hidden in the html document of a specified webpage. Somewhere in the HTML is a 'resizing-iframe' with the tag 'd2l-iframe-wrapper-for-react', which has a 'src' attribute that I want to read (see bottom picture). However, using document.getElementsByTagName doesn't work, and I suspect it is because somewhere in the HTML document, there is an iframe that itself contains an HTML document, and that one contains the element that I need (see top image). My question is: how do I get this element from this inner HTML document?

I need something like this:

var innerDocumentWrappingDiv = document.getElementsByClassName('d2l-fra-iframe')[0];
var innerDocument = innerDocumentWrappingDiv.firstChild; // the iframe containing the document
var elementThatIsNeeded = innerDocument.getElementsByTagName("d2l-iframe-wrapper-for-react")[0]; 

However this doesn't work because innerDocument is not recognized as an actual document. Any help is much appreciated!

html doc

src

about 4 years ago · Juan Pablo Isaza
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