--- a/admin/partialdata/scrapesingle.php
+++ b/admin/partialdata/scrapesingle.php
@@ -1,1 +1,811 @@
-
+hasAttributes())
+ {
+ $attrs = $root->attributes;
+
+ foreach ($attrs as $i => $attr)
+ $result[$attr->name] = $attr->value;
+ }
+
+ $children = $root->childNodes;
+if ($root->childNodes) {
+ if ($children->length == 1)
+ {
+ $child = $children->item(0);
+
+ if ($child->nodeType == XML_TEXT_NODE)
+ {
+ $result['_value'] = $child->nodeValue;
+
+ if (count($result) == 1)
+ return $result['_value'];
+ else
+ return $result;
+ }
+ }
+
+ $group = array();
+
+ for($i = 0; $i < $children->length; $i++)
+ {
+ $child = $children->item($i);
+
+ if (!isset($result[$child->nodeName]))
+ $result[$child->nodeName] = dom_to_array($child);
+ else
+ {
+ if (!isset($group[$child->nodeName]))
+ {
+ $tmp = $result[$child->nodeName];
+ $result[$child->nodeName] = array($tmp);
+ $group[$child->nodeName] = 1;
+ }
+
+ $result[$child->nodeName][] = dom_to_array($child);
+ }
+ }
+}
+
+ return $result;
+}
+
+$site = "https://www.tenders.gov.au/";
+//$cn = phpQuery::newDocument(file_get_contents("https://www.tenders.gov.au/?event=public.advancedsearch.keyword&keyword=CN".$cnid));
+$searchResult = phpQuery::newDocument('
+
+ CN ID
+
+ CN1234
+
+
+
+
+
+
+ Agency
+ Department of Veterans Affairs
+
+
+ Publish Date
+ 18-Aug-2006
+
+
+
+ Category
+ Computer services
+
+
+
+ Contract Period
+ 1-Aug-2006 to 31-Jul-2007
+
+
+ Contract Value (AUD)
+ $156,200.00
+
+
+
+ Supplier Name
+ WIZARD INFORMATION SERVICES PTY LTD
+
+
+
+
+
+ Last Updated: 18-Aug-2006 4:51 pm (ACT Local time)
+
+ Full Details
+
+
+
+
+
');
+foreach(pq('a') as $a) {
+ if (strpos($a->getAttribute("href"),"public.cn.view") >0 ) echo $a->getAttribute("href");
+ break;
+}
+$cn = phpQuery::newDocument('
+
+
+
+
+
+
+
+
+
+
+ AusTender: Contract Notice View - CN1234
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
View
+
+
+
+
+
+
+
+
Info & Links
+
+
+
+
+
+
+
+
Policies
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Home
+
+
+
+
+
+ Contract Notice View - CN1234
+
+
+
+
+
+
+
+
Contract Notice View - CN1234
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
AusTender holds Contract and Standing Offer Notices for the 07/08 financial year forward. For information related to previous years, please contact the AusTender Help Desk.
Subcontractors: For Commonwealth contracts that started on or after 1 December 2008, agencies are required to provide the names of any associated subcontractors on request. Information on subcontractors can be sought directly from the relevant agency through the Agency Contact listed in each Contract Notice.
+
+
+
+
+
+
+
+
+
+
+
+
IMU Contract Programmer: IMU-ICT040 (GAPS ID: 1611946)
+
+
+
+
+
+
+
+ CN ID
+
+
+
+ CN1234
+
+
+
+
+
+
+
+ Agency
+
+ Department of Veterans Affairs
+
+
+
+
+
+ Publish Date
+
+ 18-Aug-2006
+
+
+
+
+
+
+
+ Category
+
+ Computer services
+
+
+
+
+
+ Contract Period
+
+
+
+ 1-Aug-2006 to 31-Jul-2007
+
+
+
+
+
+
+
+ Contract Value (AUD)
+
+
+
+ $156,200.00
+
+
+
+
+
+
+
+
+
+ Description
+
+ IMU Contract Programmer: IMU-ICT040 (GAPS ID: 1611946)
+
+
+
+
+
+
+
+ Procurement Method
+
+ Open
+
+
+
+
+
+
+
+
+
+ Confidentiality - Contract
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Confidentiality - Outputs
+
+
+
+ No
+
+
+
+
+
+
+
+
+
+ Consultancy
+
+ No
+
+
+
+
+
+
+
+
+
+
+
+
Supplier Details
+
+
+
+
+
+ Name
+
+
+
+ WIZARD INFORMATION SERVICES PTY LTD
+
+
+
+
+
+
+
+
+
+ Postal Address
+
+ GPO Box 2700
+
+
+
+
+
+ Town/City
+
+ CANBERRA CITY
+
+
+
+
+
+ Postcode
+
+ 2601
+
+
+
+
+
+ State/Territory
+
+ ACT
+
+
+
+
+
+ Country
+
+ Australia
+
+
+
+
+
+ ABN
+
+
+
+ 47 008 617 561
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Agency Details
+
+
+
+
+
+
+
+ Contact Name/th>
+
+ Monico, Raymond J
+
+
+
+
+
+
+
+ Contact Phone
+
+ (02) 6289 6016
+
+
+
+
+
+
+
+ Branch
+
+ Information Management Unit
+
+
+
+
+
+
+
+ Division
+
+ National Office Compensation Division
+
+
+
+
+
+
+
+ Office Postcode
+
+ 2606
+
+
+
+
+
+ Agency Reference ID
+
+ 107460
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ');
+
+foreach(pq('tr') as $tr) {
+ $tra = dom_to_array($tr);
+ $tra['th'] = trim(str_replace("/th>","",$tra['th']));
+echo $tra['th']. " = " .trim(print_r($tra['td'],true))." \n";
+
+}
+
+?>