<p>I've been doing some HTML scraping in PHP using regular expressions.  This works, but the result is finicky and fragile.  Has anyone used any packages that provide a more robust solution?  A config driven solution would be ideal, but I'm not picky.</p>

[{'answer_id': 34145, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 6, 'selected': True, 'text': '<p>I would recomend <a href="https://sourceforge.net/projects/simplehtmldom/" rel="noreferrer">PHP Simple HTML DOM Parser</a> after you have scraped the HTML from the page. It supports invalid HTML, and provides a very easy way to handle HTML elements. </p>\n'}, {'answer_id': 34149, 'author': 'John Douthat', 'author_id': 2774, 'author_profile': 'https://Stackoverflow.com/users/2774', 'pm_score': 3, 'selected': False, 'text': '<p>If the page you\'re scraping is valid X(HT)ML, then any of <a href="http://www.php.net/manual/en/refs.xml.php" rel="noreferrer">PHP\'s built-in XML parsers</a> will do. </p>\n\n<p>I haven\'t had much success with PHP libraries for scraping. If you\'re adventurous though, you can try <a href="https://sourceforge.net/projects/simplehtmldom/" rel="noreferrer">simplehtmldom</a>. I\'d recommend <a href="http://code.whytheluckystiff.net/hpricot/" rel="noreferrer">Hpricot</a> for Ruby or <a href="http://www.crummy.com/software/BeautifulSoup/" rel="noreferrer">Beautiful Soup</a> for Python, which are both <em>excellent</em> parsers for HTML.</p>\n'}, {'answer_id': 34157, 'author': 'Jan Gorman', 'author_id': 3196, 'author_profile': 'https://Stackoverflow.com/users/3196', 'pm_score': 2, 'selected': False, 'text': '<p>I\'ve had very good with results with the <a href="https://sourceforge.net/projects/simplehtmldom/" rel="nofollow noreferrer">Simple Html DOM Parser</a> mentioned above as well. And then there\'s the \xa0<a href="http://www.php.net/tidy" rel="nofollow noreferrer">tidy Extension for PHP</a> as well which works really well too.</p>\n'}, {'answer_id': 34267, 'author': 'BlaM', 'author_id': 999, 'author_profile': 'https://Stackoverflow.com/users/999', 'pm_score': 3, 'selected': False, 'text': '<p>I had some fun working with <a href="https://github.com/hxseven/htmlSQL" rel="nofollow noreferrer">htmlSQL</a>, which is not so much a high end solution, but really simple to work with.</p>\n'}, {'answer_id': 394823, 'author': 'datasn.io', 'author_id': 49318, 'author_profile': 'https://Stackoverflow.com/users/49318', 'pm_score': 2, 'selected': False, 'text': "<p>Using PHP for HTML scraping, I'd recommend cURL + regexp or cURL + some DOM parsers though I personally use cURL + regexp. If you have a profound taste of regexp, it's actually more accurate sometimes.</p>\n"}, {'answer_id': 1214492, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': '<p>I would also recommend \'Simple HTML DOM Parser.\' It is a good option particularly if your familiar with jQuery or JavaScript selectors then you will find yourself at home.</p>\n\n<p><a href="http://blog.dougalmatthews.com/2008/08/html-dom-and-easy-screen-scraping-in-php/" rel="noreferrer">I have even blogged about it in the past.</a></p>\n'}, {'answer_id': 4332436, 'author': 'Steve', 'author_id': 527613, 'author_profile': 'https://Stackoverflow.com/users/527613', 'pm_score': 2, 'selected': False, 'text': '<p>I had to use curl on my host 1and1.</p>\n\n<p><a href="http://www.quickscrape.com/" rel="nofollow">http://www.quickscrape.com/</a> is what I came up with using the Simple DOM class!</p>\n'}]
['https://Stackoverflow.com/questions/34120', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3575/']