From d0df783bee285c4d4d604163b64d3edd40dc3816 Mon Sep 17 00:00:00 2001 From: DaanDeSmedt Date: Mon, 20 Jan 2020 15:56:33 +0100 Subject: [PATCH] Updated README.md & examples for getDOM() --- README.md | 17 +++++++++++++++++ examples/DOM.php | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 examples/DOM.php diff --git a/README.md b/README.md index 355e4a4..468e1a4 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,23 @@ print 'Screenshot saved to : ' . $headlessChromer->getFilePath(); ``` +## HTML to DOM dump + +```php +setBinaryPath('C:\Program Files (x86)\Google\Chrome\Application\chrome'); +$headlessChromer->setOutputDirectory(__DIR__); +$headlessChromer->setHTMLFile(__DIR__ . '\assets\HTMLFile.html'); +var_dump($headlessChromer->getDOM()); +``` + + ## Set mobile mode ```php diff --git a/examples/DOM.php b/examples/DOM.php new file mode 100644 index 0000000..1589e2c --- /dev/null +++ b/examples/DOM.php @@ -0,0 +1,13 @@ +setBinaryPath('C:\Program Files (x86)\Google\Chrome\Application\chrome'); +// or $headlessChromer = new HeadlessChrome(null,'C:\Program Files (x86)\Google\Chrome\Application\chrome'); + +$headlessChromer->setOutputDirectory(__DIR__); +$headlessChromer->setHTMLFile(__DIR__ . '\assets\HTMLFile.html'); +var_dump($headlessChromer->getDOM()); \ No newline at end of file