webscraping_ai 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,103 @@
1
+ =begin
2
+ #WebScraping.AI
3
+
4
+ #A client for https://webscraping.ai API. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@webscraping.ai
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for WebScrapingAI::SelectedHTMLApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'SelectedHTMLApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = WebScrapingAI::SelectedHTMLApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of SelectedHTMLApi' do
30
+ it 'should create an instance of SelectedHTMLApi' do
31
+ expect(@api_instance).to be_instance_of(WebScrapingAI::SelectedHTMLApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for get_selected
36
+ # HTML of a selected page area by URL and CSS selector
37
+ # Returns just HTML on success, JSON on error
38
+ # @param url URL of the target page
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :selector CSS selector (null by default, returns whole page HTML)
41
+ # @option opts [Hash<String, String>] :headers HTTP headers to pass to the target page. Can be specified either via a nested query parameter (...&amp;headers[One]&#x3D;value1&amp;headers&#x3D;[Another]&#x3D;value2) or as a JSON encoded object (...&amp;headers&#x3D;{\&quot;One\&quot;: \&quot;value1\&quot;, \&quot;Another\&quot;: \&quot;value2\&quot;})
42
+ # @option opts [Integer] :timeout Maximum processing time in ms. Increase it in case of timeout errors (5000 by default, maximum is 30000)
43
+ # @option opts [Boolean] :js Execute on-page JavaScript using a headless browser (true by default), costs 2 requests
44
+ # @option opts [String] :proxy Type of proxy, use residential proxies if your site restricts traffic from datacenters (datacenter by default)
45
+ # @return [nil]
46
+ describe 'get_selected test' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ # unit tests for get_selected_multiple
53
+ # HTML of multiple page areas by URL and CSS selectors
54
+ # Always returns JSON
55
+ # @param url URL of the target page
56
+ # @param [Hash] opts the optional parameters
57
+ # @option opts [Array<String>] :selectors Multiple CSS selectors (null by default, returns whole page HTML)
58
+ # @option opts [Hash<String, String>] :headers HTTP headers to pass to the target page. Can be specified either via a nested query parameter (...&amp;headers[One]&#x3D;value1&amp;headers&#x3D;[Another]&#x3D;value2) or as a JSON encoded object (...&amp;headers&#x3D;{\&quot;One\&quot;: \&quot;value1\&quot;, \&quot;Another\&quot;: \&quot;value2\&quot;})
59
+ # @option opts [Integer] :timeout Maximum processing time in ms. Increase it in case of timeout errors (5000 by default, maximum is 30000)
60
+ # @option opts [Boolean] :js Execute on-page JavaScript using a headless browser (true by default), costs 2 requests
61
+ # @option opts [String] :proxy Type of proxy, use residential proxies if your site restricts traffic from datacenters (datacenter by default)
62
+ # @return [Array<String>]
63
+ describe 'get_selected_multiple test' do
64
+ it 'should work' do
65
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
66
+ end
67
+ end
68
+
69
+ # unit tests for post_selected
70
+ # HTML of a selected page areas by URL and CSS selector, with POST request to the target page
71
+ # Returns just HTML on success, JSON on error. Request body will be passed to the target page.
72
+ # @param url URL of the target page
73
+ # @param [Hash] opts the optional parameters
74
+ # @option opts [String] :selector CSS selector (null by default, returns whole page HTML)
75
+ # @option opts [Hash<String, String>] :headers HTTP headers to pass to the target page. Can be specified either via a nested query parameter (...&amp;headers[One]&#x3D;value1&amp;headers&#x3D;[Another]&#x3D;value2) or as a JSON encoded object (...&amp;headers&#x3D;{\&quot;One\&quot;: \&quot;value1\&quot;, \&quot;Another\&quot;: \&quot;value2\&quot;})
76
+ # @option opts [Integer] :timeout Maximum processing time in ms. Increase it in case of timeout errors (5000 by default, maximum is 30000)
77
+ # @option opts [Boolean] :js Execute on-page JavaScript using a headless browser (true by default), costs 2 requests
78
+ # @option opts [String] :proxy Type of proxy, use residential proxies if your site restricts traffic from datacenters (datacenter by default)
79
+ # @return [nil]
80
+ describe 'post_selected test' do
81
+ it 'should work' do
82
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
83
+ end
84
+ end
85
+
86
+ # unit tests for post_selected_multiple
87
+ # HTML of multiple page areas by URL and CSS selectors, with POST request to the target page
88
+ # Always returns JSON. Request body will be passed to the target page.
89
+ # @param url URL of the target page
90
+ # @param [Hash] opts the optional parameters
91
+ # @option opts [Array<String>] :selectors Multiple CSS selectors (null by default, returns whole page HTML)
92
+ # @option opts [Hash<String, String>] :headers HTTP headers to pass to the target page. Can be specified either via a nested query parameter (...&amp;headers[One]&#x3D;value1&amp;headers&#x3D;[Another]&#x3D;value2) or as a JSON encoded object (...&amp;headers&#x3D;{\&quot;One\&quot;: \&quot;value1\&quot;, \&quot;Another\&quot;: \&quot;value2\&quot;})
93
+ # @option opts [Integer] :timeout Maximum processing time in ms. Increase it in case of timeout errors (5000 by default, maximum is 30000)
94
+ # @option opts [Boolean] :js Execute on-page JavaScript using a headless browser (true by default), costs 2 requests
95
+ # @option opts [String] :proxy Type of proxy, use residential proxies if your site restricts traffic from datacenters (datacenter by default)
96
+ # @return [Array<String>]
97
+ describe 'post_selected_multiple test' do
98
+ it 'should work' do
99
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
100
+ end
101
+ end
102
+
103
+ end
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #WebScraping.AI
3
3
 
4
- #This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
5
-
6
- The version of the OpenAPI document: 1.0.0
4
+ #A client for https://webscraping.ai API. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing.
7
5
 
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@webscraping.ai
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -156,7 +156,7 @@ describe WebScrapingAI::ApiClient do
156
156
  end
157
157
 
158
158
  it 'fails for invalid collection format' do
159
- expect{api_client.build_collection_param(param, :INVALID)}.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
159
+ expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
160
160
  end
161
161
  end
162
162
 
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #WebScraping.AI
3
3
 
4
- #This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
5
-
6
- The version of the OpenAPI document: 1.0.0
4
+ #A client for https://webscraping.ai API. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing.
7
5
 
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@webscraping.ai
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,7 @@ describe WebScrapingAI::Configuration do
18
18
  before(:each) do
19
19
  # uncomment below to setup host and base_path
20
20
  # require 'URI'
21
- # uri = URI.parse("https://webscraping.ai/api")
21
+ # uri = URI.parse("https://api.webscraping.ai")
22
22
  # WebScrapingAI.configure do |c|
23
23
  # c.host = uri.host
24
24
  # c.base_path = uri.path
@@ -28,14 +28,14 @@ describe WebScrapingAI::Configuration do
28
28
  describe '#base_url' do
29
29
  it 'should have the default value' do
30
30
  # uncomment below to test default value of the base path
31
- # expect(config.base_url).to eq("https://webscraping.ai/api")
31
+ # expect(config.base_url).to eq("https://api.webscraping.ai")
32
32
  end
33
33
 
34
34
  it 'should remove trailing slashes' do
35
35
  [nil, '', '/', '//'].each do |base_path|
36
36
  config.base_path = base_path
37
37
  # uncomment below to test trailing slashes
38
- # expect(config.base_url).to eq("https://webscraping.ai/api")
38
+ # expect(config.base_url).to eq("https://api.webscraping.ai")
39
39
  end
40
40
  end
41
41
  end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #WebScraping.AI
3
+
4
+ #A client for https://webscraping.ai API. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@webscraping.ai
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for WebScrapingAI::Error
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'Error' do
21
+ before do
22
+ # run before each test
23
+ @instance = WebScrapingAI::Error.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of Error' do
31
+ it 'should create an instance of Error' do
32
+ expect(@instance).to be_instance_of(WebScrapingAI::Error)
33
+ end
34
+ end
35
+ describe 'test attribute "message"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,47 @@
1
+ =begin
2
+ #WebScraping.AI
3
+
4
+ #A client for https://webscraping.ai API. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@webscraping.ai
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for WebScrapingAI::PageError
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'PageError' do
21
+ before do
22
+ # run before each test
23
+ @instance = WebScrapingAI::PageError.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of PageError' do
31
+ it 'should create an instance of PageError' do
32
+ expect(@instance).to be_instance_of(WebScrapingAI::PageError)
33
+ end
34
+ end
35
+ describe 'test attribute "status_code"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "status_message"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #WebScraping.AI
3
3
 
4
- #This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
5
-
6
- The version of the OpenAPI document: 1.0.0
4
+ #A client for https://webscraping.ai API. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing.
7
5
 
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@webscraping.ai
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -3,12 +3,12 @@
3
3
  =begin
4
4
  #WebScraping.AI
5
5
 
6
- #A client for https://webscraping.ai API. It provides Chrome JS rendering, rotating proxies and HTML parsing for web scraping.
7
-
8
- The version of the OpenAPI document: 1.0.0
6
+ #A client for https://webscraping.ai API. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing.
9
7
 
8
+ The version of the OpenAPI document: 2.0.0
9
+ Contact: support@webscraping.ai
10
10
  Generated by: https://openapi-generator.tech
11
- OpenAPI Generator version: 4.2.3
11
+ OpenAPI Generator version: 4.3.1
12
12
 
13
13
  =end
14
14
 
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.email = ["hello@webscraping.ai"]
24
24
  s.homepage = "https://webscraping.ai"
25
25
  s.summary = "WebScraping.AI Ruby Gem"
26
- s.description = "A client for https://webscraping.ai API. It provides Chrome JS rendering, rotating proxies and HTML parsing for web scraping."
26
+ s.description = "A client for https://webscraping.ai API. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing."
27
27
  s.license = 'MIT'
28
28
  s.required_ruby_version = ">= 1.9"
29
29
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webscraping_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WebScraping.AI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-27 00:00:00.000000000 Z
11
+ date: 2020-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -34,44 +34,44 @@ dependencies:
34
34
  name: json
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '2.1'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
39
  version: 2.1.0
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '2.1'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '2.1'
50
47
  - - ">="
51
48
  - !ruby/object:Gem::Version
52
49
  version: 2.1.0
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '2.1'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rspec
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: '3.6'
60
57
  - - ">="
61
58
  - !ruby/object:Gem::Version
62
59
  version: 3.6.0
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '3.6'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '3.6'
70
67
  - - ">="
71
68
  - !ruby/object:Gem::Version
72
69
  version: 3.6.0
73
- description: A client for https://webscraping.ai API. It provides Chrome JS rendering,
74
- rotating proxies and HTML parsing for web scraping.
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '3.6'
73
+ description: A client for https://webscraping.ai API. It provides a web scaping automation
74
+ API with Chrome JS rendering, rotating proxies and builtin HTML parsing.
75
75
  email:
76
76
  - hello@webscraping.ai
77
77
  executables: []
@@ -79,23 +79,28 @@ extensions: []
79
79
  extra_rdoc_files: []
80
80
  files:
81
81
  - Gemfile
82
- - Gemfile.lock
83
82
  - README.md
84
83
  - Rakefile
85
- - docs/HtmlApi.md
86
- - docs/ScrappedPage.md
84
+ - docs/Error.md
85
+ - docs/HTMLApi.md
86
+ - docs/PageError.md
87
+ - docs/SelectedHTMLApi.md
87
88
  - git_push.sh
88
89
  - lib/webscraping_ai.rb
89
90
  - lib/webscraping_ai/api/html_api.rb
91
+ - lib/webscraping_ai/api/selected_html_api.rb
90
92
  - lib/webscraping_ai/api_client.rb
91
93
  - lib/webscraping_ai/api_error.rb
92
94
  - lib/webscraping_ai/configuration.rb
93
- - lib/webscraping_ai/models/scrapped_page.rb
95
+ - lib/webscraping_ai/models/error.rb
96
+ - lib/webscraping_ai/models/page_error.rb
94
97
  - lib/webscraping_ai/version.rb
95
98
  - spec/api/html_api_spec.rb
99
+ - spec/api/selected_html_api_spec.rb
96
100
  - spec/api_client_spec.rb
97
101
  - spec/configuration_spec.rb
98
- - spec/models/scrapped_page_spec.rb
102
+ - spec/models/error_spec.rb
103
+ - spec/models/page_error_spec.rb
99
104
  - spec/spec_helper.rb
100
105
  - webscraping_ai.gemspec
101
106
  homepage: https://webscraping.ai
@@ -117,13 +122,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
122
  - !ruby/object:Gem::Version
118
123
  version: '0'
119
124
  requirements: []
120
- rubygems_version: 3.1.2
125
+ rubygems_version: 3.0.3
121
126
  signing_key:
122
127
  specification_version: 4
123
128
  summary: WebScraping.AI Ruby Gem
124
129
  test_files:
125
130
  - spec/api/html_api_spec.rb
131
+ - spec/api/selected_html_api_spec.rb
126
132
  - spec/api_client_spec.rb
127
133
  - spec/configuration_spec.rb
128
- - spec/models/scrapped_page_spec.rb
134
+ - spec/models/error_spec.rb
135
+ - spec/models/page_error_spec.rb
129
136
  - spec/spec_helper.rb
@@ -1,70 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- webscraping_ai (1.0.0)
5
- json (~> 2.1, >= 2.1.0)
6
- typhoeus (~> 1.0, >= 1.0.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- ast (2.4.0)
12
- byebug (11.1.1)
13
- coderay (1.1.2)
14
- diff-lcs (1.3)
15
- ethon (0.12.0)
16
- ffi (>= 1.3.0)
17
- ffi (1.12.2)
18
- jaro_winkler (1.5.4)
19
- json (2.3.0)
20
- method_source (1.0.0)
21
- parallel (1.19.1)
22
- parser (2.7.0.5)
23
- ast (~> 2.4.0)
24
- pry (0.13.0)
25
- coderay (~> 1.1)
26
- method_source (~> 1.0)
27
- pry-byebug (3.9.0)
28
- byebug (~> 11.0)
29
- pry (~> 0.13.0)
30
- psych (3.1.0)
31
- rainbow (3.0.0)
32
- rake (12.0.0)
33
- rspec (3.9.0)
34
- rspec-core (~> 3.9.0)
35
- rspec-expectations (~> 3.9.0)
36
- rspec-mocks (~> 3.9.0)
37
- rspec-core (3.9.1)
38
- rspec-support (~> 3.9.1)
39
- rspec-expectations (3.9.1)
40
- diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.9.0)
42
- rspec-mocks (3.9.1)
43
- diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.9.0)
45
- rspec-support (3.9.2)
46
- rubocop (0.66.0)
47
- jaro_winkler (~> 1.5.1)
48
- parallel (~> 1.10)
49
- parser (>= 2.5, != 2.5.1.1)
50
- psych (>= 3.1.0)
51
- rainbow (>= 2.2.2, < 4.0)
52
- ruby-progressbar (~> 1.7)
53
- unicode-display_width (>= 1.4.0, < 1.6)
54
- ruby-progressbar (1.10.1)
55
- typhoeus (1.3.1)
56
- ethon (>= 0.9.0)
57
- unicode-display_width (1.5.0)
58
-
59
- PLATFORMS
60
- ruby
61
-
62
- DEPENDENCIES
63
- pry-byebug
64
- rake (~> 12.0.0)
65
- rspec (~> 3.6, >= 3.6.0)
66
- rubocop (~> 0.66.0)
67
- webscraping_ai!
68
-
69
- BUNDLED WITH
70
- 2.1.2