An Introduction to PHP Web Scraping
Over at Thoughtful Code, I recently published an introduction to PHP web scraping based on some hard-won lessons I’ve had over the last few months doing it for keeps. It’s a skill that few people have, and which you might want to use carefully, but it’s super powerful when you need data you can see on a web page, have a reasonable legal right to, and can’t get from a comfortable and friendly programming API.
Here’s how I think about it:
In short, web scraping should always be the last resort. You’re doing a thing that the content-producer is at best a little disappointed with. If they wanted to make that information available to you, and they could, they would have. They may truly not have the technical capacity, or interest. Which is when web scraping is a great fit. Because a slow-moving website is one of the best targets for scraping data from websites using PHP.
Obviously, we all make our own choices. But I love what I’ve been able to use Symfony Panther to do in recent months. Even though it just saves me a few minutes a day. I makes my life better for sure. If that seems like it could be the case for you, please give this web scraping tutorial a look.