Class: GrabzIt::HTMLOptions

Inherits:
BaseOptions show all
Defined in:
lib/grabzit/htmloptions.rb

Overview

Represents all of the options available when creating rendered HTML

Author:

  • GrabzIt

Version:

  • 3.0

Instance Method Summary collapse

Methods inherited from BaseOptions

#country, #country=, #customId, #customId=, #encryptionKey, #encryptionKey=, #exportURL, #exportURL=, #proxy, #proxy=

Constructor Details

#initializeHTMLOptions

Returns a new instance of HTMLOptions.



8
9
10
11
12
13
14
15
16
17
# File 'lib/grabzit/htmloptions.rb', line 8

def initialize()
	super()
	@browserWidth = nil
	@browserHeight = nil
	@waitForElement = nil
	@requestAs = 0
	@noAds = false
	@noCookieNotifications = false
	@address = 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.

Parameters:

  • name (String)

    the name of the HTTP Post parameter

  • value (String)

    the value of the HTTP Post parameter



128
129
130
# File 'lib/grabzit/htmloptions.rb', line 128

def add_post_parameter(name, value)
	@post = appendParameter(@post, name, value)
end

#addressString

Returns get the URL to execute the HTML code in.

Returns:

  • (String)

    get the URL to execute the HTML code in



111
112
113
# File 'lib/grabzit/htmloptions.rb', line 111

def address
	@address
end

#address=(value) ⇒ void

This method returns an undefined value.

Set the URL to execute the HTML code in

Parameters:

  • value (String)

    the address



119
120
121
# File 'lib/grabzit/htmloptions.rb', line 119

def address=(value)
	@address = value
end

#browserHeightInteger

Returns the height of the browser in pixels.

Returns:

  • (Integer)

    the height of the browser in pixels



33
34
35
# File 'lib/grabzit/htmloptions.rb', line 33

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

Parameters:

  • value (Integer)

    the browser height



41
42
43
# File 'lib/grabzit/htmloptions.rb', line 41

def browserHeight=(value)
	@browserHeight = value
end

#browserWidthInteger

Returns the width of the browser in pixels.

Returns:

  • (Integer)

    the width of the browser in pixels



20
21
22
# File 'lib/grabzit/htmloptions.rb', line 20

def browserWidth
	@browserWidth
end

#browserWidth=(value) ⇒ void

This method returns an undefined value.

Set the width of the browser in pixels

Parameters:

  • value (Integer)

    the browser width



28
29
30
# File 'lib/grabzit/htmloptions.rb', line 28

def browserWidth=(value)
	@browserWidth = value
end

#delayInteger

Returns get the number of milliseconds to wait before creating the capture.

Returns:

  • (Integer)

    get the number of milliseconds to wait before creating the capture



46
47
48
# File 'lib/grabzit/htmloptions.rb', line 46

def delay
	@delay
end

#delay=(value) ⇒ void

This method returns an undefined value.

Set the number of milliseconds to wait before creating the capture

Parameters:

  • value (Integer)

    the delay



54
55
56
# File 'lib/grabzit/htmloptions.rb', line 54

def delay=(value)
	@delay = value
end

#noAdsBoolean

Returns get if adverts should be automatically hidden.

Returns:

  • (Boolean)

    get if adverts should be automatically hidden



85
86
87
# File 'lib/grabzit/htmloptions.rb', line 85

def noAds
	@noAds
end

#noAds=(value) ⇒ void

This method returns an undefined value.

Set to true if adverts should be automatically hidden

Parameters:

  • value (Boolean)

    hide adverts



93
94
95
# File 'lib/grabzit/htmloptions.rb', line 93

def noAds=(value)
	@noAds = value
end

#noCookieNotificationsBoolean

Returns get if cookie notifications should be automatically hidden.

Returns:

  • (Boolean)

    get if cookie notifications should be automatically hidden



98
99
100
# File 'lib/grabzit/htmloptions.rb', line 98

def noCookieNotifications
	@noCookieNotifications
end

#noCookieNotifications=(value) ⇒ void

This method returns an undefined value.

Set to true if cookie notifications should be automatically hidden

Parameters:

  • value (Boolean)

    hide cookie notifications



106
107
108
# File 'lib/grabzit/htmloptions.rb', line 106

def noCookieNotifications=(value)
	@noCookieNotifications = value
end

#requestAsInteger

Returns get which user agent type should be used.

Returns:

  • (Integer)

    get which user agent type should be used



72
73
74
# File 'lib/grabzit/htmloptions.rb', line 72

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

Parameters:

  • value (Integer)

    the browser type



80
81
82
# File 'lib/grabzit/htmloptions.rb', line 80

def requestAs=(value)
	@requestAs = value
end

#waitForElementString

Returns get the CSS selector of the HTML element in the web page that must be visible before the capture is performed.

Returns:

  • (String)

    get the CSS selector of the HTML element in the web page that must be visible before the capture is performed



59
60
61
# File 'lib/grabzit/htmloptions.rb', line 59

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

Parameters:

  • value (String)

    the element to wait for



67
68
69
# File 'lib/grabzit/htmloptions.rb', line 67

def waitForElement=(value)
	@waitForElement = value
end