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>