Hello friends today I am going to tell you about simple HTML Dom tutorial. if you want to parse any website then this tutorial will help you. I will create a series of post that contain a simple HTML Dom tutorial so in this article we will discuss about how HTML Dom .


  1. Download the simple HTML Dom zip file by clicking  here
  2. Put this file on your server after the zip file


Here here DOM stands for document object model now if you want to create DOM from any URL then you have to follow the following procedure:


First create a index.php page and write the following code on that page

<!DOCTYPE html>
<html lang="en-US" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="UTF-8">
</head>
<body>
<?php
include "simple_html_dom.php";
$url = "http://www.google.com";
$html = file_get_html($url);

?>
</body>
</html>


here if you want to create a DOM of any URL then you must use the following code in PHP so that all the HTML version of the file can be loaded on the document

$url = "http://www.google.com";
$html = file_get_html($url);

In the  next tutorial we will see that how can we extract the parts of the HTML for example if we want to extract the all images of the webpage or if we want to extract the all links from the HTML then what should we do