From 6e0589f9a06ad21a9235eca66234b06dc7f99201 Mon Sep 17 00:00:00 2001 From: Dag Date: Fri, 25 Mar 2022 03:06:00 +0100 Subject: [PATCH] [EconomistBridge] fix: broken bridge Fixes: Call to a member function find() on boo The new-style articles had their DOM changed. --- bridges/EconomistBridge.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridges/EconomistBridge.php b/bridges/EconomistBridge.php index 652c7ea6..f14036e1 100644 --- a/bridges/EconomistBridge.php +++ b/bridges/EconomistBridge.php @@ -102,10 +102,12 @@ class EconomistBridge extends FeedExpander { $contentNode = 'div.layout-article-body'; $imgNode = 'div.article__lead-image'; $categoryNode = 'span.article__subheadline'; - } else { - $contentNode = 'div.e4sqmp1'; - $imgNode = 'figure.e3y6nua0'; + } elseif ($article->find('article', 0)->getAttribute('data-test-id') === 'NewArticle') { + $contentNode = 'section'; + $imgNode = 'figure.css-12eysrk.e3y6nua0'; $categoryNode = 'span.ern1uyf0'; + } else { + // pass } $item['content'] = $this->cleanContent($article, $contentNode);