Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

85
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!