0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Easy Web Scraping using PHP Simple HTML DOM Parser Library

Posted at

Simple HTML DOM is a PHP library to parse data from webpages, in short you can use this library to do web scraping using PHP and even store data to MySQL database. Simple HTML DOM has following features:

  1. The parser library is written in PHP 5+.
  2. It requires PHP 5+ to run.
  3. Parser supports invalid HTML parsing.
  4. It allows to select html tags like Jquery way.
  5. Supports Xpath and CSS path based web extraction.
  6. Provides both the way – Object oriented way and procedure way to write code.

Scraping all links

load_file("http://www.google.com"); // This will Find all links foreach($html->find('a') as $element) echo $element->href . '
'; ?>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?