PHP Classes

Very simple page details: Parse and extract Web page information details

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 63%Total: 241 All time: 7,997 This week: 102Up
Version License PHP version Categories
php-vspd 1.4.0Custom (specified...5HTML, PHP 5, Parsers
Description 

Author

This class can parse and extract Web page information details.

It can retrieve a Web page from a given URL and parse it to extract details like:

- Page title
- Page head and body
- Meta tags
- Character set
- Links expanded to full path
- Images
- Page headers from H1 through H6
- Internal and external links checking if they are broken
- Page elements by class or id value

Recommendations

Link Checker
Find broken links in a Web site

Extract div data or tags text from Web pages
I need to extract the values that are in divs of the same class

What is the best PHP web content crawler class?
Extracting content by passing the URL of a web site

Extract text or links from a web page
i need to parse and extract text

Retrieve a page content
I need a crawler to get a data from an url

Picture of zinsou A.A.E.Moïse
  Performance   Level  
Name: zinsou A.A.E.Moïse is available for providing paid consulting. Contact zinsou A.A.E.Moïse .
Classes: 50 packages by
Country: Benin Benin
Age: 33
All time rank: 6831 in Benin Benin
Week rank: 21 Up1 in Benin Benin Equal
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

Example

<?php session_start(); ?>
<!DOCTYPE HTML>
<html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
    <title>Test</title>
    </head>
    <body>

<?php
set_time_limit
(0);
include_once
"VSPD.class.php";
 
//$obj=new VSPD("https://www.phpclasses.org/");

 
$obj=new VSPD("https://fr.investing.com/indices/major-indices",stream_context_create($opts = array(
 
'http'=>array(
   
'method'=>"GET",
   
'user_agent'=>"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
 
)
)));
// echo "Page title:";
// echo '<pre>'.$obj->getTitle().'</pre>';

// echo "All Images:";
// echo '<pre>'.print_r($obj->getImages(),true).'</pre>';



// echo "Internal links:";

// echo '<pre>'.print_r($obj->getInternalinks(true),true).'</pre>';

// echo "External links:";

// echo '<pre>'.print_r($obj->getExternalinks(true),true).'</pre>';
// echo "Headers:";
// echo '<pre>'.print_r($obj->getHeaders(),true).'</pre>';
// echo "Header1:";
// echo '<pre>'.print_r($obj->getH1(),true).'</pre>';
// echo "Header2:";
// echo '<pre>'.print_r($obj->getH2(),true).'</pre>';
// echo "Header3:";
// echo '<pre>'.print_r($obj->getH3(),true).'</pre>';
// echo "CHARSET:";
echo '<pre>'.print_r($obj-> getCharset(),true).'</pre>';
echo
"METAS:";
echo
'<pre>'.print_r($obj-> XplicitMeta(),true).'</pre>';
// echo "Specifics tag:";
// echo '<pre>'.print_r($obj-> getDTag('div'),true).'</pre>';
// echo '<pre>'.print_r($obj-> getSTag('img'),true).'</pre>';
// echo '<pre>'.var_dump($obj->getElementsByTagName('div')).'</pre>';
echo '<pre>'.print_r($obj-> getOG(),true).'</pre>';
echo
'<pre>'.print_r($obj-> getTwitterTags(),true).'</pre>';
echo
'<pre>'.print_r($obj-> getHttpEquiv(),true).'</pre>';
// echo "BROKEN LINKS:";
// echo '<pre>'.var_dump($obj->check_broken_externalLinks()).'</pre>';
// echo "check FAKE BROKEN LINKS:";
// $ar=array('https://www.phpclasses.org/browse/mouton.html','https://www.phpclasses.org/voleur.html','https://www.stupidthieves.com','www.phpclasses.org/');
// foreach($ar as $k=>$v){
// if(VSPD::is_broken_link($v)) $brokens[]=$v;
// }
// echo '<pre>';
// var_dump($brokens);
// echo '</pre>';
?>
</body>
</html>


  Files folder image Files  
File Role Description
Accessible without login Plain text file license.txt Lic. license file
Accessible without login Plain text file readme.txt Doc. readme
Accessible without login Plain text file test.php Example example script
Plain text file VSPD.class.php Class class source

 Version Control Unique User Downloads Download Rankings  
 0%
Total:241
This week:0
All time:7,997
This week:102Up
User Ratings User Comments (2)
 All time
Utility:66%StarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:100%StarStarStarStarStarStar
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:63%StarStarStarStar
Rank:1002
 
I try your php code on PHPCLASSES : « Very simple page deta...
5 years ago (Dominique VARLET)
42%StarStarStar
Very good.
5 years ago (Alekos Psimikakis)
67%StarStarStarStar