Fix featured and content scraping

This commit is contained in:
2021-06-10 00:54:12 +05:00
parent 7086227a98
commit 8ba9c814c5

View File

@@ -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();
});