Class: GrabzIt::HTMLOptions
- Inherits:
-
BaseOptions
- Object
- BaseOptions
- GrabzIt::HTMLOptions
- Defined in:
- lib/grabzit/htmloptions.rb
Overview
Represents all of the options available when creating rendered HTML
Instance Method Summary collapse
-
#add_post_parameter(name, value) ⇒ Object
Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters.
-
#address ⇒ String
Get the URL to execute the HTML code in.
-
#address=(value) ⇒ void
Set the URL to execute the HTML code in.
-
#browserHeight ⇒ Integer
The height of the browser in pixels.
-
#browserHeight=(value) ⇒ void
Set the height of the browser in pixels.
-
#browserWidth ⇒ Integer
The width of the browser in pixels.
-
#browserWidth=(value) ⇒ void
Set the width of the browser in pixels.
-
#clickElement ⇒ String
Get the CSS selector of the HTML element in the web page that must clicked before the capture is performed.
-
#clickElement=(value) ⇒ void
Set the CSS selector of the HTML element in the web page that must clicked before the capture is performed.
-
#delay ⇒ Integer
Get the number of milliseconds to wait before creating the capture.
-
#delay=(value) ⇒ void
Set the number of milliseconds to wait before creating the capture.
-
#hoverElement ⇒ String
Get the CSS selector of the HTML element in the web page that must hovered over before the capture is performed.
-
#hoverElement=(value) ⇒ void
Set the CSS selector of the HTML element in the web page that must hovered over before the capture is performed.
-
#initialize ⇒ HTMLOptions
constructor
A new instance of HTMLOptions.
-
#inlineHTML ⇒ Boolean
Get if the HTML should be inlined.
-
#inlineHTML=(value) ⇒ void
Set to true if the resources in a web page should be inlined in the HTML.
-
#jsCode ⇒ String
Get the JavaScript code that will be execute in the web page before the capture is performed.
-
#jsCode=(value) ⇒ void
Set the JavaScript code that will be execute in the web page before the capture is performed.
-
#noAds ⇒ Boolean
Get if adverts should be automatically hidden.
-
#noAds=(value) ⇒ void
Set to true if adverts should be automatically hidden.
-
#noCookieNotifications ⇒ Boolean
Get if cookie notifications should be automatically hidden.
-
#noCookieNotifications=(value) ⇒ void
Set to true if cookie notifications should be automatically hidden.
-
#requestAs ⇒ Integer
Get which user agent type should be used.
-
#requestAs=(value) ⇒ void
Set which user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3.
-
#scrollElement ⇒ String
Get the CSS selector of the HTML element in the web page that must scroll to before the capture is performed.
-
#scrollElement=(value) ⇒ void
Set the CSS selector of the HTML element in the web page that must scroll to before the capture is performed.
-
#waitForElement ⇒ String
Get the CSS selector of the HTML element in the web page that must be visible before the capture is performed.
-
#waitForElement=(value) ⇒ void
Set the CSS selector of the HTML element in the web page that must be visible before the capture is performed.
Methods inherited from BaseOptions
#country, #country=, #customId, #customId=, #encryptionKey, #encryptionKey=, #exportURL, #exportURL=, #proxy, #proxy=
Constructor Details
#initialize ⇒ HTMLOptions
Returns a new instance of HTMLOptions.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/grabzit/htmloptions.rb', line 8 def initialize() super() @browserWidth = nil @browserHeight = nil @waitForElement = nil @requestAs = 0 @noAds = false @noCookieNotifications = false @address = nil @clickElement = nil @jsCode = nil @inlineHTML = false @scrollElement = nil @hoverElement = nil end |
Instance Method Details
#add_post_parameter(name, value) ⇒ Object
Define a HTTP Post parameter and optionally value, this method can be called multiple times to add multiple parameters. Using this method will force GrabzIt to perform a HTTP post.
198 199 200 |
# File 'lib/grabzit/htmloptions.rb', line 198 def add_post_parameter(name, value) @post = appendParameter(@post, name, value) end |
#address ⇒ String
Returns get the URL to execute the HTML code in.
168 169 170 |
# File 'lib/grabzit/htmloptions.rb', line 168 def address @address end |
#address=(value) ⇒ void
This method returns an undefined value.
Set the URL to execute the HTML code in
176 177 178 |
# File 'lib/grabzit/htmloptions.rb', line 176 def address=(value) @address = value end |
#browserHeight ⇒ Integer
Returns the height of the browser in pixels.
38 39 40 |
# File 'lib/grabzit/htmloptions.rb', line 38 def browserHeight @browserHeight end |
#browserHeight=(value) ⇒ void
This method returns an undefined value.
Set the height of the browser in pixels. Use -1 to screenshot the whole web page
46 47 48 |
# File 'lib/grabzit/htmloptions.rb', line 46 def browserHeight=(value) @browserHeight = value end |
#browserWidth ⇒ Integer
Returns the width of the browser in pixels.
25 26 27 |
# File 'lib/grabzit/htmloptions.rb', line 25 def browserWidth @browserWidth end |
#browserWidth=(value) ⇒ void
This method returns an undefined value.
Set the width of the browser in pixels
33 34 35 |
# File 'lib/grabzit/htmloptions.rb', line 33 def browserWidth=(value) @browserWidth = value end |
#clickElement ⇒ String
Returns get the CSS selector of the HTML element in the web page that must clicked before the capture is performed.
77 78 79 |
# File 'lib/grabzit/htmloptions.rb', line 77 def clickElement @clickElement end |
#clickElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the HTML element in the web page that must clicked before the capture is performed
85 86 87 |
# File 'lib/grabzit/htmloptions.rb', line 85 def clickElement=(value) @clickElement = value end |
#delay ⇒ Integer
Returns get the number of milliseconds to wait before creating the capture.
51 52 53 |
# File 'lib/grabzit/htmloptions.rb', line 51 def delay @delay end |
#delay=(value) ⇒ void
This method returns an undefined value.
Set the number of milliseconds to wait before creating the capture
59 60 61 |
# File 'lib/grabzit/htmloptions.rb', line 59 def delay=(value) @delay = value end |
#hoverElement ⇒ String
Returns get the CSS selector of the HTML element in the web page that must hovered over before the capture is performed.
103 104 105 |
# File 'lib/grabzit/htmloptions.rb', line 103 def hoverElement @hoverElement end |
#hoverElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the HTML element in the web page that must hovered over before the capture is performed
111 112 113 |
# File 'lib/grabzit/htmloptions.rb', line 111 def hoverElement=(value) @hoverElement = value end |
#inlineHTML ⇒ Boolean
Returns get if the HTML should be inlined.
155 156 157 |
# File 'lib/grabzit/htmloptions.rb', line 155 def inlineHTML @inlineHTML end |
#inlineHTML=(value) ⇒ void
This method returns an undefined value.
Set to true if the resources in a web page should be inlined in the HTML
163 164 165 |
# File 'lib/grabzit/htmloptions.rb', line 163 def inlineHTML=(value) @inlineHTML = value end |
#jsCode ⇒ String
Returns get the JavaScript code that will be execute in the web page before the capture is performed.
181 182 183 |
# File 'lib/grabzit/htmloptions.rb', line 181 def jsCode @jsCode end |
#jsCode=(value) ⇒ void
This method returns an undefined value.
Set the JavaScript code that will be execute in the web page before the capture is performed
189 190 191 |
# File 'lib/grabzit/htmloptions.rb', line 189 def jsCode=(value) @jsCode = value end |
#noAds ⇒ Boolean
Returns get if adverts should be automatically hidden.
129 130 131 |
# File 'lib/grabzit/htmloptions.rb', line 129 def noAds @noAds end |
#noAds=(value) ⇒ void
This method returns an undefined value.
Set to true if adverts should be automatically hidden
137 138 139 |
# File 'lib/grabzit/htmloptions.rb', line 137 def noAds=(value) @noAds = value end |
#noCookieNotifications ⇒ Boolean
Returns get if cookie notifications should be automatically hidden.
142 143 144 |
# File 'lib/grabzit/htmloptions.rb', line 142 def noCookieNotifications @noCookieNotifications end |
#noCookieNotifications=(value) ⇒ void
This method returns an undefined value.
Set to true if cookie notifications should be automatically hidden
150 151 152 |
# File 'lib/grabzit/htmloptions.rb', line 150 def noCookieNotifications=(value) @noCookieNotifications = value end |
#requestAs ⇒ Integer
Returns get which user agent type should be used.
116 117 118 |
# File 'lib/grabzit/htmloptions.rb', line 116 def requestAs @requestAs end |
#requestAs=(value) ⇒ void
This method returns an undefined value.
Set which user agent type should be used: Standard Browser = 0, Mobile Browser = 1, Search Engine = 2 and Fallback Browser = 3
124 125 126 |
# File 'lib/grabzit/htmloptions.rb', line 124 def requestAs=(value) @requestAs = value end |
#scrollElement ⇒ String
Returns get the CSS selector of the HTML element in the web page that must scroll to before the capture is performed.
90 91 92 |
# File 'lib/grabzit/htmloptions.rb', line 90 def scrollElement @scrollElement end |
#scrollElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the HTML element in the web page that must scroll to before the capture is performed
98 99 100 |
# File 'lib/grabzit/htmloptions.rb', line 98 def scrollElement=(value) @scrollElement = value end |
#waitForElement ⇒ String
Returns get the CSS selector of the HTML element in the web page that must be visible before the capture is performed.
64 65 66 |
# File 'lib/grabzit/htmloptions.rb', line 64 def waitForElement @waitForElement end |
#waitForElement=(value) ⇒ void
This method returns an undefined value.
Set the CSS selector of the HTML element in the web page that must be visible before the capture is performed
72 73 74 |
# File 'lib/grabzit/htmloptions.rb', line 72 def waitForElement=(value) @waitForElement = value end |