Browse Source

Cleanup the HTML before parsing it.

pull/1242/head
Michael Vogel 7 years ago
parent
commit
620ee6be0b
  1. 5
      include/Scrape.php

5
include/Scrape.php

@ -263,6 +263,11 @@ function scrape_feed($url) {
}
try {
// Cleanup invalid HTML
$doc = new DOMDocument();
@$doc->loadHTML($s);
$s = $doc->saveHTML();
$dom = HTML5_Parser::parse($s);
} catch (DOMException $e) {
logger('scrape_feed: parse error: ' . $e);

Loading…
Cancel
Save