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

220
Views
how do I get a tables data from a website using javascript?

I am trying to take data's from my university website and am using javascript fully. Is there a way to take data's in each row and add them to the table in my website ? These data's Data's needed This is the website https://banner.kfu.edu.sa:7710/KFU/ws?p_trm_code=144310&p_col_code=09&p_sex_code=11

When I tried to do it using my code My javascript

This is the result I'm getting Result

My code

 <table id="myTable" style="width:100%" >
    <tr>
      <th>Course name</th>
      <th>Section</th>
      <th>Time</th>
      <th>Instructor name</th>
      <th>CRN</th>
    </tr>
  </table>
    
  </div>

 

 <script>
    var table = document.getElementById("myTable");
  
    var xhr = new XMLHttpRequest();

    xhr.open("Get","https://banner.kfu.edu.sa:7710/KFU/ws?p_trm_code=144310&p_col_code=09&p_sex_code=11");
    xhr.responseType = "document";

    xhr.onload = function(){

      if(xhr.readyState == 4 && xhr.status==200){
      //copies the entire xml of the web page
        var response = xhr.responseXML.querySelectorAll(".normaltxt");
        var row = table.insertRow(1);
        
        response.forEach(function(numbers)
        { var courseNameCell = row.insertCell(0);
          courseNameCell.innerHTML = response.table;
          
        })
        console.log(response);
        
      }
      
    };
     xhr.onerror = function(){
       console.error(xhr.status, xhr.statusText);
    
     }
     xhr.send();

  </script>

about 4 years ago · Santiago Trujillo
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!