Use an HTML parser. NOT regular expressions. The problem with regular expressions is that they cannot match nested structures. Assuming your regex must match a single <div> and its closing tag, there is no way to correctly match this input:
Tag Archives: scrape
How to Scrape Meta Tags From Any Web Page With PHP
A couple of weeks ago I was going to work on a new project, it was a directory-like kind of app. One the things this application had to do was let users add their websites to their profiles, and so the first question came up, “how am going to get their website’s title and meta …
Continue reading “How to Scrape Meta Tags From Any Web Page With PHP”