From 8ba9c814c5c612569697ec203bdf2f8f4234829f Mon Sep 17 00:00:00 2001 From: Mohamed jinas Date: Thu, 10 Jun 2021 00:54:12 +0500 Subject: [PATCH] Fix featured and content scraping --- app/Services/Scrapers/ThiladhunScraper.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Services/Scrapers/ThiladhunScraper.php b/app/Services/Scrapers/ThiladhunScraper.php index 3ef4834..7a4e3f9 100644 --- a/app/Services/Scrapers/ThiladhunScraper.php +++ b/app/Services/Scrapers/ThiladhunScraper.php @@ -44,13 +44,11 @@ class ThiladhunScraper }); - $crawler->filter('div.single-body.entry-content.typography-copy p')->each(function ($node) { + $crawler->filter('div.elementor-widget-container > p')->each(function ($node) { $this->content[] = preg_replace("/[a-zA-Z]/", "", $node->text());; }); - $crawler->filter('div[class*="entry-thumb single-entry-thumb"] img')->each(function ($node) { - $this->image = $node->attr('src'); - }); + dd($crawler->filter('div[data-widget_type*="theme-post-featured-image.default"] figure img')->first()->attr('src')); $crawler->filter('.entry-tags a')->each(function ($node) { if(!preg_match('/[^A-Za-z0-9-]/', basename($node->attr('href')))) @@ -63,7 +61,7 @@ class ThiladhunScraper }); - $crawler->filter('a[class*="entry-author__name"]')->each(function ($node) { + $crawler->filter('a > .elementor-post-info__item--type-author')->each(function ($node) { $this->author = $node->text(); });