Azoruk's avatar

Image crawling/scraping with Laravel?

Just to preface, I have never used a crawler or scraper before in my life.

There's a neat feature on reddit where if you submit a link, it'll crawl the website, find the biggest image (or find an image with an open graph tag), shrink down the image and create a thumbnail with that image.

I want to do this on my website.

I'm making this thread because I want advice on how I could implement this. Is there a good package for this sort of thing? Will certain crawlers be better for what I'm looking for than others?

0 likes
2 replies
bobbybouwmann's avatar

If you're looking into crawling yourself you can use this package: https://github.com/spatie/crawler

Finding the biggest picture on a website is a whole other case! You should probably collect all image urls on the page and fetch them one by one and see what image has the biggest size.

2 likes
Azoruk's avatar

No no, I just want to crawl to find the biggest image on the page. Not the entire website.

Please or to participate in this conversation.