Save Images from html Remotely

Here is the simple php code to save the all images from html web page to server remotely :- <?php $doc = new DOMDocument(); @$doc->loadHTML($content); $tags = $doc->getElementsByTagName(‘img’); $count_img = 0; foreach ($tags as $tag) { $img = $tag->getAttribute(‘src’); $count_img++; $a = explode(“?”,$img); $image = $a[0]; $b = remoteImageUpload($image); $my_img = “http://www.jaihindutva.com/post/”.$b; $content = str_replace($img,$my_img,$content); […]

Read More

Simple HTML Dom tutorial part-3 -extracting text from a URL

In the previous tutorial we have seen that how can we extract links images from a URL . now in this tutorial we will learn how to extract the plain text from a URL or div or any other tag <!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.fabulouspost.com/2017/06/kaise-pata-lagaye-koi-aappar-fida-hai.html”;$html = file_get_html($url);echo $html->plaintext; ?></body></html> After […]

Read More

Simple HTML Dom tutorial part 2 -extracting link and image from a website

In the previous tutorial we learn about the simple HTML Dom we have successfully installed the term PHP file in our server now we want to extract data from any website is we want to extract any image or links then we should follow the following code <!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 […]

Read More

Simple HTML Dom tutorial – part -1 -Introduction

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 . Download the […]

Read More