page scraping on php

if you are looking for page scraping help on php you can use below mentioned 2 function to fetch a web page then parse it as you wish. It’s using php curl extension and some string processing functions. Before start using it you need to enable the php_curl extension first then follow the below steps.

Getting a full webpage content:


Parsing a page html content:

<?php
$subHtmlContent =  getValueByTagName($pageHtmlContent, '
', '
'); ?>

Then you can now process the rest of content as you need. Above mentioned getPage and getValueByTagName functions are defined below you need to include them on you php page to use it.


Thank you for reading.

2 thoughts on “page scraping on php

    1. It’s constantly working as I know 🙂 You may be miss-placed the getValueByTagName calling parameters. First see the code before you use it. Thanks

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: