Skip to content

Commit

Permalink
Ignore warnings about bad html
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagogomesverissimo committed Mar 27, 2020
1 parent a367726 commit bfcd19a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@ public function getMemberlist() {
foreach($urlsForLetters as $url) {
$response = $this->client->request('GET', $url);

$dom = new \DOMDocument;
$dom->loadHTML($response->getBody());
$dom = new \DOMDocument('1.0', 'UTF-8');

// set error level
$internalErrors = libxml_use_internal_errors(true);

$dom->loadHTML($response->getBody());

// Restore error level
libxml_use_internal_errors($internalErrors);

$tables = $dom->getElementsByTagName("table")[4];
$trs = $tables->getElementsByTagName("tr");
Expand Down

0 comments on commit bfcd19a

Please sign in to comment.