Class: SelectPdf::WebElementsClient
- Defined in:
- lib/selectpdf.rb
Overview
Get the locations of certain web elements. This is retrieved if pdf_web_elements_selectors parameter was set during the initial conversion call and elements were found to match the selectors.
Instance Attribute Summary
Attributes inherited from ApiClient
#api_async_endpoint, #api_endpoint, #api_web_elements_endpoint, #async_calls_max_pings, #async_calls_ping_interval, #number_of_pages
Instance Method Summary collapse
-
#initialize(api_key, job_id) ⇒ WebElementsClient
constructor
Construct the web elements client.
-
#web_elements ⇒ Object
Get the locations of certain web elements.
Constructor Details
#initialize(api_key, job_id) ⇒ WebElementsClient
Construct the web elements client.
1483 1484 1485 1486 1487 1488 |
# File 'lib/selectpdf.rb', line 1483 def initialize(api_key, job_id) super() @api_endpoint = 'https://selectpdf.com/api2/webelements/' @parameters['key'] = api_key @parameters['job_id'] = job_id end |
Instance Method Details
#web_elements ⇒ Object
Get the locations of certain web elements. This is retrieved if pdf_web_elements_selectors parameter is set and elements were found to match the selectors.
1494 1495 1496 1497 1498 1499 1500 1501 |
# File 'lib/selectpdf.rb', line 1494 def web_elements @headers['Accept'] = 'text/json' result = perform_post return JSON.parse(result) unless result.nil? || result.empty? [] end |