From 7006c41ba0a7b4da4f08a14310481e1ab5f08625 Mon Sep 17 00:00:00 2001 From: Matthieu Rakotojaona Date: Wed, 21 Aug 2024 20:13:09 +0200 Subject: [PATCH] [HackerNews] Fix tag containing comment [HackerNews] Fix tag containing comment --- bridges/HackerNewsUserThreadsBridge.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bridges/HackerNewsUserThreadsBridge.php b/bridges/HackerNewsUserThreadsBridge.php index 0ab7445db251..5f466f9f1604 100644 --- a/bridges/HackerNewsUserThreadsBridge.php +++ b/bridges/HackerNewsUserThreadsBridge.php @@ -40,7 +40,10 @@ public function collectData() $item['author'] = $author; $item['title'] = $title; $item['timestamp'] = $element->find('span[class*="age"]', 0)->find('a', 0)->innertext; - $item['content'] = $element->find('span[class*="commtext"]', 0)->innertext; + $contentDiv = $element->find('div[class*="commtext"]', 0); + if (!empty($contentDiv)) { + $item['content'] = $contentDiv->innertext; + } $this->items[] = $item; }