-2

I know this is asked 1000x on this website but I cant get it to work.

I want to get the table information from this website with the current style: https://webuntis.a12.nl/WebUntis/?school=roc%20a12#Timetable?type=1&departmentId=0

So I tried this (fiddle here):

<div id="wrap"></div>
<script>
    $.get('https://webuntis.a12.nl/WebUntis/?school=roc%20a12#Timetable?type=1&departmentId=0', function(data) {
        var wrap = $('#mainTable', $(data));
    });
</script>

But it wont do anything. Perhaps it can be done with PHP?

Chris Kempen
  • 9,491
  • 5
  • 40
  • 52
Patrick Falize
  • 599
  • 1
  • 6
  • 11

2 Answers2

0

You are running into a cross domain security issue. You are basicaly not allowed to do requests from one domain to another. What you could do is putting everything inside an iframe

<body>
<html>
this is my page
< iframe src="https://webuntis.a12.nl/WebUntis/?school=roc%20a12#Timetable?   type=1&departmentId=0" height=500 width=500></iframe>
</html>
</body>

Another option could be a server site scraper. Its a bit more complex, but what it does is basicaly making a copy of that specific url and stores it on server to be served from your domain.

Gillis Haasnoot
  • 2,229
  • 1
  • 19
  • 23
0

You can use curl() function to get all the contents of that page. Store its response in a variable, use regular expression to extract all the data inside div id=timetable (This div contain the table you are looking for)

Mayank Sharma
  • 844
  • 7
  • 21