PHP Curl get information from a Website which loaded with JavaScript

时间:2018-12-19 11:37:22

标签: php web curl

I have a big problem and I could not find any help in other Forums.

My problem: I make a Android App for a swimming club. One function of the App is to manage the swimmer. So i like to find automatically they best swimming time with only their names.

There is a website with this function : http://www.dsv.de/schwimmen/wettkampf-national/schwimmerabfrage/

There I must insert a first name(Vorname) and a surname (Nachname) and confirm this with a button. For example: Paul Biedermann.

Then I must click on best times (Bestzeiten) on the right and then i see a table with all the information. And i like to find the information with PHP and safe it to my Databank.

This was my try:

<?php
$url = 'https://dsvdaten.dsv.de/Modules/Results/Individual.aspx?Lang=de-DE';
$data = array('_firstnameTextBox' => 'vorname', '_lastnameTextBox' => 'nachname');
$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
        'method'  => 'POST',
        'content' => http_build_query($data)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }
var_dump($result);
?>

But I do not figure out how I get the table of this site.

0 个答案:

没有答案