I found my way around web scraping and i'm trying to figure out he proper way to get data from the buffer that is filled with the page.
i'm including my variables, that have timezone and simple html dom in it
i get the img's and the titles from searching the dom, but can't seem to find a way to have multiple queries with the foreach, i know i'm missing on knowledge here, but i've hit bottom on searching and reading.
i get variables from a previous form using get thats why i have the query string on the top.
what i need is :
to fetch the data in an array
to be able to use them inside a table and such. (image on the left wrapped text on the right and some other data.)
thank you in advance, help is going to be greatly appreciated.
<?php
// includes and variables
include($_SERVER["DOCUMENT_ROOT"] . "/includes/variables.php"); // all includes
// decleratus
$url = 'http://www.domain.com/file.php?'.$_SERVER['QUERY_STRING']; // url+selected from prev
// shd stuff
$html = new simple_html_dom(); // Load shd
$html->load_file($url); // Load a file
// 1st array
foreach ($html->find("div.row img") as $varImgStr)
{
$varImg = '<p style="margin-left:25px">' . $varImgStr. '</p>';
echo $varImg ;
}
// 2nd array
foreach ($html->find("div.row span strong") as $varTitleStr)
{
$varTitle = '<p style="margin-left:25px">' . $varTitleStr. '</p>';
echo $varTitle ;
}
// does echo full $html output
//echo $html;
// clear mem
$html->clear();
?>
I'm deploying on my workplace an off-line (no internet needed) app using Php Desktop.
What i'm using :
- PHP Desktop
- portable apache with php-cli and sqlite features, setting don't allow resizing and maximizing, only minimizing and other goodies
- BAT scripts
- bat2exe and the script fetches the main executable and settings file from a server on the network, result is always validated files and data (included temporary wget/unzip/rm unix binaries for windows)
- jQuery, Zepto and others for the Navigation
- Right click disabler, plus left click enabled only for single click on images and/or links and no selection.
- Notepad++ with may plugins