PHP Classes

PHP Scrape Website Links: Parse and extract links and images from Web pages

Recommend this page to a friend!
  Info   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 1,224 All time: 3,118 This week: 488Up
Version License PHP version Categories
website-parser 1.0.1The PHP License5.0HTML, PHP 5, Web services
Description 

Author

This class can parse and extract links and images from Web pages.

It can send a HTTP request to the server of a given URL and retrieves a page to be parsed.

The class searches the retrieved page to extract the URLs of links and images.

Picture of Morshed Alam
  Performance   Level  
Name: Morshed Alam <contact>
Classes: 2 packages by
Country: Bangladesh Bangladesh
Age: 44
All time rank: 175324 in Bangladesh Bangladesh
Week rank: 192 Up3 in Bangladesh Bangladesh Up

Details

About

A Website parser class to extract links and images from Web pages. View Demo or Try it out and Rate on phpclasses.org

Uses

<pre><code>include 'website_parser.php';

//Instance of WebsiteParser $parser = new WebsiteParser('http://morshed-alam.com/');

//Get all hyper links $links = $parser->getHrefLinks();

//Get all image sources $images = $parser->getImageSources();

//Get all meta tags and Facebook open graph properties $meta_tags = $parser->getMetaTags();</code></pre>

Contributing

  1. Fork it
  2. Create your feature branch (`git checkout -b my-new-feature`)
  3. Commit your changes (`git commit -am 'Added some feature'`)
  4. Push to the branch (`git push origin my-new-feature`)
  5. Create new Pull Request

Screenshots (1)  
  • screenshot.png
  Files folder image Files (10)  
File Role Description
Files folder imageviews (4 files)
Accessible without login Plain text file cookie.txt Data Cookie
Accessible without login Plain text file example.php Example Example to extract website urls
Accessible without login Plain text file index.php Example Example of Uses
Accessible without login Plain text file README.md Data modify readme
Plain text file website_parser.php Class Parser class

  Files folder image Files (10)  /  views  
File Role Description
  Accessible without login Plain text file href.html.php Aux. To render To render hyper links
  Accessible without login Plain text file image.html.php Aux. To render images
  Accessible without login HTML file meta.html.php Example Example script
  Accessible without login HTML file title.html.php Example Example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:1,224
This week:0
All time:3,118
This week:488Up
User Ratings User Comments (1)
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1499
 
in truncateText() method I would use http://www.
11 years ago (Rad Paluszak)
70%StarStarStarStar