diff --git a/composer.json b/composer.json index 9d7b6fb..551fc55 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "homepage": "https://grabz.it/", "description": "Use our API to allow your app to create images, DOCX documents, rendered HTML and PDF's from URL's or raw HTML. Additionally GrabzIt allows you to convert online videos into animated GIF's or HTML tables into CSV's.", "license": "MIT", - "version":"3.4.5", + "version":"3.5.0", "autoload": { "psr-4": { "GrabzIt\\": "lib/" diff --git a/lib/GrabzItDOCXOptions.php b/lib/GrabzItDOCXOptions.php index 4a07d8c..037b5ac 100644 --- a/lib/GrabzItDOCXOptions.php +++ b/lib/GrabzItDOCXOptions.php @@ -15,6 +15,7 @@ class GrabzItDOCXOptions extends GrabzItBaseOptions private $marginRight = 10; private $requestAs = 0; private $quality = -1; + private $clickElement = null; private $hideElement = null; private $waitForElement = null; private $noAds = false; @@ -191,6 +192,22 @@ public function getTitle() return $this->title; } + /* + Set the CSS selector of the HTML element in the web page to click. + */ + public function setClickElement($value) + { + $this->clickElement = $value; + } + + /* + Get the CSS selector of the HTML element in the web page to click. + */ + public function getClickElement() + { + return $this->clickElement; + } + /* Set the CSS selector of the only HTML element in the web page to capture. */ @@ -478,7 +495,7 @@ public function _getSignatureString($applicationSecret, $callBackURL, $url = nul $this->nullToEmpty($this->hideElement)."|".$this->nullToEmpty($this->getExportURL())."|".$this->nullToEmpty($this->waitForElement)."|". $this->nullToEmpty($this->getEncryptionKey())."|".$this->nullToEmpty(intval($this->noAds))."|".$this->nullToEmpty($this->post)."|". $this->nullToEmpty($this->targetElement)."|".$this->nullToEmpty($this->templateId)."|".$this->nullToEmpty($this->templateVariables)."|". - $this->nullToEmpty($this->height)."|".$this->nullToEmpty($this->width)."|".$this->nullToEmpty($this->browserWidth)."|".$this->nullToEmpty($this->getProxy())."|".$this->nullToEmpty($this->mergeId)."|".$this->nullToEmpty($this->address)."|".$this->nullToEmpty(intval($this->noCookieNotifications))."|".$this->nullToEmpty($this->password); + $this->nullToEmpty($this->height)."|".$this->nullToEmpty($this->width)."|".$this->nullToEmpty($this->browserWidth)."|".$this->nullToEmpty($this->getProxy())."|".$this->nullToEmpty($this->mergeId)."|".$this->nullToEmpty($this->address)."|".$this->nullToEmpty(intval($this->noCookieNotifications))."|".$this->nullToEmpty($this->password."|".$this->nullToEmpty($this->clickElement)); } public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue) @@ -511,6 +528,7 @@ public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $ $params['address'] = $this->nullToEmpty($this->address); $params['nonotify'] = $this->nullToEmpty(intval($this->noCookieNotifications)); $params['password'] = $this->nullToEmpty($this->password); + $params['click'] = $this->nullToEmpty($this->clickElement); return $params; } diff --git a/lib/GrabzItException.php b/lib/GrabzItException.php index b2f4b4c..848e410 100644 --- a/lib/GrabzItException.php +++ b/lib/GrabzItException.php @@ -76,6 +76,7 @@ class GrabzItException extends \Exception { const PARAMETER_INVALID_MEDIA_TYPE = 177; const PARAMETER_INVALID_PASSWORD = 178; const PARAMETER_INVALID_MERGE = 179; + const PARAMETER_INVALID_CLICK_VALUE = 180; const NETWORK_SERVER_OFFLINE = 200; const NETWORK_GENERAL_ERROR = 201; const NETWORK_DDOS_ATTACK = 202; diff --git a/lib/GrabzItImageOptions.php b/lib/GrabzItImageOptions.php index 537c3d9..55e3048 100644 --- a/lib/GrabzItImageOptions.php +++ b/lib/GrabzItImageOptions.php @@ -11,6 +11,7 @@ class GrabzItImageOptions extends GrabzItBaseOptions private $width = null; private $height = null; private $format = null; + private $clickElement = null; private $targetElement = null; private $hideElement = null; private $waitForElement = null; @@ -99,6 +100,22 @@ public function getFormat() { return $this->format; } + + /* + Set the CSS selector of the HTML element in the web page to click. + */ + public function setClickElement($value) + { + $this->clickElement = $value; + } + + /* + Get the CSS selector of the HTML element in the web page to click. + */ + public function getClickElement() + { + return $this->clickElement; + } /* Set the CSS selector of the only HTML element in the web page to capture. @@ -323,7 +340,7 @@ public function _getSignatureString($applicationSecret, $callBackURL, $url = nul ."|".$this->nullToEmpty($this->browserWidth)."|".$this->nullToEmpty($this->getCustomId())."|".$this->nullToEmpty($this->delay)."|".$this->nullToEmpty($this->targetElement) ."|".$this->nullToEmpty($this->customWaterMarkId)."|".$this->nullToEmpty(intval($this->requestAs))."|".$this->nullToEmpty($this->getCountry())."|". $this->nullToEmpty($this->quality)."|".$this->nullToEmpty($this->hideElement)."|".$this->nullToEmpty($this->getExportURL())."|". - $this->nullToEmpty($this->waitForElement)."|".$this->nullToEmpty(intval($this->transparent))."|".$this->nullToEmpty($this->getEncryptionKey())."|".$this->nullToEmpty(intval($this->noAds))."|".$this->nullToEmpty($this->post)."|".$this->nullToEmpty($this->getProxy())."|".$this->nullToEmpty($this->address)."|".$this->nullToEmpty(intval($this->noCookieNotifications))."|".$this->nullToEmpty(intval($this->hd)); + $this->nullToEmpty($this->waitForElement)."|".$this->nullToEmpty(intval($this->transparent))."|".$this->nullToEmpty($this->getEncryptionKey())."|".$this->nullToEmpty(intval($this->noAds))."|".$this->nullToEmpty($this->post)."|".$this->nullToEmpty($this->getProxy())."|".$this->nullToEmpty($this->address)."|".$this->nullToEmpty(intval($this->noCookieNotifications))."|".$this->nullToEmpty(intval($this->hd))."|".$this->nullToEmpty($this->clickElement); } public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue) @@ -347,6 +364,7 @@ public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $ $params['address'] = $this->nullToEmpty($this->address); $params['nonotify'] = $this->nullToEmpty(intval($this->noCookieNotifications)); $params['hd'] = $this->nullToEmpty(intval($this->hd)); + $params['click'] = $this->nullToEmpty($this->clickElement); return $params; } diff --git a/lib/GrabzItPDFOptions.php b/lib/GrabzItPDFOptions.php index 3f2ff49..0ba9b07 100644 --- a/lib/GrabzItPDFOptions.php +++ b/lib/GrabzItPDFOptions.php @@ -18,6 +18,7 @@ class GrabzItPDFOptions extends GrabzItBaseOptions private $templateId = null; private $customWaterMarkId = null; private $quality = -1; + private $clickElement = null; private $targetElement = null; private $hideElement = null; private $waitForElement = null; @@ -227,6 +228,22 @@ public function getCoverURL() return $this->coverURL; } + /* + Set the CSS selector of the HTML element in the web page to click. + */ + public function setClickElement($value) + { + $this->clickElement = $value; + } + + /* + Get the CSS selector of the HTML element in the web page to click. + */ + public function getClickElement() + { + return $this->clickElement; + } + /* Set the CSS selector of the only HTML element in the web page to capture. */ @@ -531,7 +548,7 @@ public function _getSignatureString($applicationSecret, $callBackURL, $url = nul $this->nullToEmpty($this->waitForElement)."|".$this->nullToEmpty($this->getEncryptionKey())."|".$this->nullToEmpty(intval($this->noAds))."|". $this->nullToEmpty($this->post)."|".$this->nullToEmpty($this->browserWidth)."|".$this->nullToEmpty($this->height)."|".$this->nullToEmpty($this->width)."|". $this->nullToEmpty($this->templateVariables)."|".$this->nullToEmpty($this->getProxy())."|".$this->nullToEmpty($this->mergeId)."|".$this->nullToEmpty($this->address)."|".$this->nullToEmpty(intval($this->noCookieNotifications))."|".$this->nullToEmpty($this->cssMediaType)."|". - $this->nullToEmpty($this->password); + $this->nullToEmpty($this->password)."|".$this->nullToEmpty($this->clickElement); } public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue) @@ -567,6 +584,7 @@ public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $ $params['nonotify'] = $this->nullToEmpty(intval($this->noCookieNotifications)); $params['media'] = $this->nullToEmpty($this->cssMediaType); $params['password'] = $this->nullToEmpty($this->password); + $params['click'] = $this->nullToEmpty($this->clickElement); return $params; } diff --git a/readme.txt b/readme.txt index f8374d7..cd3d5df 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -GrabzIt 3.4 +GrabzIt 3.5 =========== This library allows you to programmatically convert HTML and URL's into images, DOCX documents, rendered HTML, PDF's, CSV's, spreadsheets and JSON. Additionally GrabzIt allows you to convert online videos into animated GIF's.