Nov 17, 2022 11:49 AM
(This post was last modified: Dec 19, 2022 08:40 AM by Shellcode™.)
Hey!
So while working on countless scraper scripts, I have compiled my own little PHP Class to do the process as simple & handy as I want it to be.. :)
So why keep it for my-self, and not share my work? Hell yeah!
This will come in very handy for you, if you need a very quick way to do data scraping with minimal effort! If you have any questions or requests, please contact me.
/Scraper.php
https://rentry.co/daiub
Basic Example:
Let me know if you need any further instructions on how to utilize the methods within this class.
So while working on countless scraper scripts, I have compiled my own little PHP Class to do the process as simple & handy as I want it to be.. :)
So why keep it for my-self, and not share my work? Hell yeah!
This will come in very handy for you, if you need a very quick way to do data scraping with minimal effort! If you have any questions or requests, please contact me.
/Scraper.php
https://rentry.co/daiub
Basic Example:
PHP Code
<?php
function PullTableData($url) {
if($content = $this->curl($url)) {
$listings_html = $this->getValueByTagName($content, '<div id="mainblock">', '<div class="leftblock">');
$listings_html_Arr = explode('<div class="lbm">', $listings_html);
array_shift($listings_html_Arr);
foreach($listings_html_Arr as $key => $data) {
// populate data with info returned by $data & $key..
$items[$key] = array(
'identifier' => 'paramter'
);
}
}
else {
echo 'Unable to load the URL Provided: ' .$url;
return false;
}
return $items;
}
Let me know if you need any further instructions on how to utilize the methods within this class.


![[Image: O444cFs.jpg]](https://i.ibb.co/c2rr5jw/O444cFs.jpg)
