Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screnshots are blank images encoded to base64 #19

Open
Nolesh opened this issue Feb 18, 2019 · 1 comment
Open

Screnshots are blank images encoded to base64 #19

Nolesh opened this issue Feb 18, 2019 · 1 comment

Comments

@Nolesh
Copy link

Nolesh commented Feb 18, 2019

Hi,
I tried this scraper and noticed that only 2 first screenshots are valid. The rest ones are blank images encoded to base64 (data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw).
How to solve this issue?
Thank you.

@droidmanspace
Copy link

droidmanspace commented Mar 18, 2019

Hi,
I tried this scraper and noticed that only 2 first screenshots are valid. The rest ones are blank images encoded to base64 (data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw).
How to solve this issue?
Thank you.

edit vendor ->raul -> Scapper.php and replace the $info['screenshots'] with the below code :

$info['screenshots'] = $crawler->filter('[jscontroller="jt8Aqb"]')->each(function ($node) { 
            if(strlen($node->filter('img')->attr('data-src')) == 0){
                return substr($node->filter('img')->attr('src'), 0, strpos($node->filter('img')->attr('src'), "="));
            }else{
                return $node->filter('img')->attr('data-src');
            }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants