[DownDetectorBridge] Fix bridge (#1528)

This commit is contained in:
Joseph 2020-05-17 18:04:37 +00:00 committed by GitHub
parent f48909b84e
commit 63a4db7e86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6125,9 +6125,16 @@ class DownDetectorBridge extends BridgeAbstract {
$table = $html->find('table.table-striped', 0);
$maxCount = 10;
foreach ($table->find('tr') as $downEvent) {
$downLink = $downEvent->find('td', 1)->find('a', 1);
$item = $this->collectArticleData($downLink->getAttribute('href'));
foreach ($table->find('tr') as $event) {
$td = $event->find('td', 0);
if (is_null($td)) {
continue;
}
$link = $event->find('td', 0)->find('a', 0);
$item = $this->collectArticleData($link->getAttribute('href'));
$this->items[] = $item;
if($maxCount == 0) break;
$maxCount -= 1;