소스 검색

show only main table

develop
Robin Thoni 7 년 전
부모
커밋
21a0954e09
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10
    1
      index.php

+ 10
- 1
index.php 파일 보기

@@ -25,4 +25,13 @@ $response = $client->request('POST', 'https://wprodl.uqac.ca/dossier_etudiant/gr
25 25
         'session' => getenv('PERIOD')
26 26
     ]
27 27
 ]);
28
-echo (string)$response->getBody();
28
+
29
+$body = (string)$response->getBody();
30
+
31
+$doc = new DOMDocument();
32
+$doc->loadHTML($body);
33
+$xpath = new DOMXpath($doc);
34
+$div = $xpath->query("//div[@id='partie_centrale']");
35
+$table = $doc->saveHTML($div[0]);
36
+
37
+echo $table;

Loading…
취소
저장