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

88
Visualizações
DOMParser is not working in certain websites

I'm making a chrome extension.

I'm trying to get some pages' html through the javascript.

I found the code I can use in this site.

Here is the code:

fetch(url)
  .then(function (response) { // When the page is loaded convert it to text
    return response.text()
  })
  .then(function (html) { // Initialize the DOM parser
    const parser = new DOMParser();  // Parse the text

    const doc = parser.parseFromString(html, "text/html");
    
    console.log(doc);
  })
  .catch(function (err) {
    console.log('Failed to fetch page: ', err);
  });

Luckily, in most websites this code works well, but in a certain site this doesn't work well.

Here is the link I have problem with: https://ja.dict.naver.com/#/entry/jako/c650d30f378b49dca0ecd6ea85fcc258

I want all nodes' texts but through this code, the "body" part doesn't show up.

enter image description here

I have searched google, this site and other reference but I can't found the solution and don't know why.

Isn't there way to solve this problem?

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