From a88514ef7c0bbcec5c6b63a727d85d077a23b113 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 13 Feb 2017 16:09:49 +0100 Subject: [PATCH] Create WebParser.php --- Utils/Crawler/WebParser.php | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Utils/Crawler/WebParser.php diff --git a/Utils/Crawler/WebParser.php b/Utils/Crawler/WebParser.php new file mode 100644 index 000000000..d9559830c --- /dev/null +++ b/Utils/Crawler/WebParser.php @@ -0,0 +1,62 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +declare(strict_types=1); +namespace phpOMS\Utils\Crawler; +/** + * Array utils. + * + * @category Framework + * @package phpOMS\Utils + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class WebParser +{ + private $uri = ''; + private $doc = null; + private $finder = null; + + public function __construct(string $uri) + { + $this->uri = $uri; + } + + private function download($uri) + { + $handle = curl_init($uri); + curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); + + $this->doc = new \DOMDocument(); + $this->doc->loadHTML($this->content); + $this->finder = new \DomXPath($this->doc); + } + + public function get(string $xpath) + { + $nodes = $finder->query($xpath); + } + + private function parseTable($node) + { + } + + private function parseList($node) + { + } +}