selenium_spider 0.1.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.
- checksums.yaml +7 -0
- data/.gitignore +29 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +65 -0
- data/Rakefile +6 -0
- data/bin/selenium-spider +35 -0
- data/examples/controllers/yahoo_controller.rb +4 -0
- data/examples/models/yahoo.rb +11 -0
- data/examples/paginations/yahoo_pagination.rb +5 -0
- data/lib/selenium_spider/command_line.rb +82 -0
- data/lib/selenium_spider/controller.rb +46 -0
- data/lib/selenium_spider/generations/controller.rb.erb +4 -0
- data/lib/selenium_spider/generations/model.rb.erb +7 -0
- data/lib/selenium_spider/generations/pagination.rb.erb +10 -0
- data/lib/selenium_spider/model.rb +69 -0
- data/lib/selenium_spider/pagination.rb +62 -0
- data/lib/selenium_spider/version.rb +3 -0
- data/lib/selenium_spider.rb +6 -0
- data/selenium_spider.gemspec +41 -0
- data/tmp/.gitkeep +0 -0
- metadata +193 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 76ff5357511b1365df2358b3e41b17b252f4b026
|
4
|
+
data.tar.gz: ebcc5c4c7226aedd5f8de4037d4ccff7e3025a61
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 214ea8cb65257f0213e40c97626cb8138c0c5f90ec5dfb6776fb265c3858096acb01edbde107f01e1ca918ec21a684891fa3ac09dd602d2f90f2460590757f0c
|
7
|
+
data.tar.gz: 8ff7c57b423572a2158afb767477b6737fff986c7a6fc4d17fe242c3951823a471b0f54270a4b0333c56eb7926c0904dbbf2595ea13b993716e278d2cc1f6771
|
data/.gitignore
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
*.rbc
|
2
|
+
.env
|
3
|
+
.powenv
|
4
|
+
.rspec
|
5
|
+
.rvmrc
|
6
|
+
/.bundle
|
7
|
+
/.yardoc
|
8
|
+
/Gemfile.lock
|
9
|
+
/_yardoc/
|
10
|
+
/coverage/
|
11
|
+
/db/*.sqlite3
|
12
|
+
/db/*.sqlite3-journal
|
13
|
+
/doc/
|
14
|
+
/log
|
15
|
+
/pkg/
|
16
|
+
/public/system
|
17
|
+
/spec/reports/
|
18
|
+
/spec/tmp
|
19
|
+
/tmp/*
|
20
|
+
!/tmp/.gitkeep
|
21
|
+
/vendor/bundle
|
22
|
+
capybara-*.html
|
23
|
+
config/initializers/secret_token.rb
|
24
|
+
config/secrets.yml
|
25
|
+
pickle-email-*.html
|
26
|
+
rerun.txt
|
27
|
+
|
28
|
+
# Demo app for experiment
|
29
|
+
/app
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.0
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at ketsume0211@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 五所和哉
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
[](https://travis-ci.org/acro5piano/selenium_spider)
|
2
|
+
|
3
|
+
# Selenium Spider
|
4
|
+
|
5
|
+
Scrape websites using Firefox headlessly handled by Selenium.
|
6
|
+
|
7
|
+
This will have these features:
|
8
|
+
|
9
|
+
### Full JavaScript support
|
10
|
+
|
11
|
+
Based on Selenium Standalone DSL which run Firefox headlessly, it comprehences JavaScript completely.
|
12
|
+
|
13
|
+
### PMC architecture
|
14
|
+
|
15
|
+
MPC = Model Pagination Controller
|
16
|
+
|
17
|
+
Generally, scraping is consist of two parts: Listing page and Detail page.
|
18
|
+
|
19
|
+
In MPC architecture, Model is for extracting information from detail page and store data to database.
|
20
|
+
|
21
|
+
Page is for listing items and pagenation.
|
22
|
+
|
23
|
+
Controller is for handling the above two.
|
24
|
+
|
25
|
+
### Web-based task execution
|
26
|
+
|
27
|
+
Scraping tasks are often multiply and difficult to arrange.
|
28
|
+
|
29
|
+
Imagine Web-based task execution, definition, csv-export and scheduling like Jenkins.
|
30
|
+
|
31
|
+
## Installation
|
32
|
+
|
33
|
+
Add this line to your application's Gemfile:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
gem 'selenium_spider'
|
37
|
+
```
|
38
|
+
|
39
|
+
And then execute:
|
40
|
+
|
41
|
+
$ bundle
|
42
|
+
|
43
|
+
Or install it yourself as:
|
44
|
+
|
45
|
+
$ gem install selenium_spider
|
46
|
+
|
47
|
+
## Usage
|
48
|
+
|
49
|
+
(Comming)
|
50
|
+
|
51
|
+
## Development
|
52
|
+
|
53
|
+
After checking out the repo, run `rake spec` to run the tests.
|
54
|
+
|
55
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/acro5piano/selenium_spider. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
60
|
+
|
61
|
+
|
62
|
+
## License
|
63
|
+
|
64
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
65
|
+
|
data/Rakefile
ADDED
data/bin/selenium-spider
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'selenium_spider'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
options = {}
|
7
|
+
options[:command] = ARGV[0]
|
8
|
+
|
9
|
+
OptionParser.new do |parser|
|
10
|
+
parser.banner = "SeleniumSpider #{SeleniumSpider::VERSION}\n\n"
|
11
|
+
parser.separator "Usage: selenium-spider command [option]\n"
|
12
|
+
|
13
|
+
parser.separator "Commands:"
|
14
|
+
%w(run generate).each do |cmd|
|
15
|
+
parser.separator " " + cmd
|
16
|
+
end
|
17
|
+
|
18
|
+
parser.separator "Options for command 'run':"
|
19
|
+
parser.on('-s site', '--site=site', "サイト名") { |v| options[:site] = v }
|
20
|
+
parser.on('--headless', 'GUI無しで動作(xvfbが必要)') { |v| options[:headless] = v }
|
21
|
+
|
22
|
+
parser.separator "Options for command 'generate':"
|
23
|
+
parser.on('-s site', '--site=site', "サイト名") { |v| options[:site] = v }
|
24
|
+
|
25
|
+
parser.separator "Other options"
|
26
|
+
parser.on('-h', '--help', "Show this message") do
|
27
|
+
puts parser
|
28
|
+
exit 1
|
29
|
+
end
|
30
|
+
|
31
|
+
parser.parse! ARGV
|
32
|
+
end
|
33
|
+
|
34
|
+
SeleniumSpider::CommandLine.execute options
|
35
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'active_support'
|
4
|
+
require 'active_support/core_ext'
|
5
|
+
require 'tilt'
|
6
|
+
|
7
|
+
$LOAD_PATH.unshift File.expand_path('../../../app', __FILE__)
|
8
|
+
$LOAD_PATH.unshift File.expand_path('../../../examples', __FILE__)
|
9
|
+
|
10
|
+
module SeleniumSpider
|
11
|
+
class CommandLine
|
12
|
+
def self.execute(options)
|
13
|
+
new(options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(options)
|
17
|
+
@options = options
|
18
|
+
|
19
|
+
if @options[:command] == 'run'
|
20
|
+
run
|
21
|
+
elsif @options[:command] == 'generate'
|
22
|
+
generate
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def run
|
27
|
+
if @options[:headless]
|
28
|
+
headless = Headless.new(reuse: false, destroy_at_exit: true)
|
29
|
+
headless.start
|
30
|
+
end
|
31
|
+
|
32
|
+
require "models/#{@options[:site]}"
|
33
|
+
require "paginations/#{@options[:site]}_pagination"
|
34
|
+
require "controllers/#{@options[:site]}_controller"
|
35
|
+
|
36
|
+
class_name = @options[:site].classify + 'Controller'
|
37
|
+
Object.const_get(class_name).new.run
|
38
|
+
|
39
|
+
if @options[:headless]
|
40
|
+
headless.destroy
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def generate
|
45
|
+
mkdir_if_not_exist './app/models/'
|
46
|
+
mkdir_if_not_exist './app/paginations/'
|
47
|
+
mkdir_if_not_exist './app/controllers/'
|
48
|
+
|
49
|
+
gem_root = File.expand_path('../lib', ENV['BUNDLE_GEMFILE'])
|
50
|
+
generation_path = "#{gem_root}/selenium_spider/generations"
|
51
|
+
|
52
|
+
generate_class "#{generation_path}/model.rb.erb",
|
53
|
+
"./app/models/#{@options[:site]}.rb"
|
54
|
+
generate_class "#{generation_path}/pagination.rb.erb",
|
55
|
+
"./app/paginations/#{@options[:site]}_pagination.rb"
|
56
|
+
generate_class "#{generation_path}/controller.rb.erb",
|
57
|
+
"./app/controllers/#{@options[:site]}_controller.rb"
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def generate_class(from, to)
|
63
|
+
if File.exist? to
|
64
|
+
puts 'Skip: ' + to
|
65
|
+
return
|
66
|
+
end
|
67
|
+
|
68
|
+
open(to, 'w') do |f|
|
69
|
+
template = Tilt.new(from)
|
70
|
+
f.puts template.render(self, site_class: @options[:site].classify)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def mkdir_if_not_exist(path)
|
75
|
+
return if File.exist? path
|
76
|
+
|
77
|
+
require 'fileutils'
|
78
|
+
FileUtils.mkdir_p './app/models/'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require "selenium_standalone_dsl"
|
2
|
+
|
3
|
+
module SeleniumSpider
|
4
|
+
class Controller
|
5
|
+
def self.crawl_urls(urls)
|
6
|
+
@@urls = urls
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@type = self.class.to_s.sub('Controller', '')
|
11
|
+
@pagination_class = @type + 'Pagination'
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
@@urls.each_with_index do |url, idx|
|
16
|
+
@pagination = SeleniumSpider.const_get(@pagination_class).new(url)
|
17
|
+
@pagination.before_crawl idx
|
18
|
+
|
19
|
+
while true
|
20
|
+
if (detail_links = @pagination.detail_links)
|
21
|
+
detail_links.each do |detail_link|
|
22
|
+
extract_info location: detail_link
|
23
|
+
end
|
24
|
+
else
|
25
|
+
extract_info driver: @pagination.driver
|
26
|
+
end
|
27
|
+
|
28
|
+
break if !@pagination.continue?
|
29
|
+
@pagination.next
|
30
|
+
end
|
31
|
+
|
32
|
+
@pagination.quit
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def extract_info(location: nil, driver: nil)
|
37
|
+
model = SeleniumSpider.const_get(@type).new(location: location, driver: driver)
|
38
|
+
@pagination.attributes.each do |key, value|
|
39
|
+
model.set_attributes_value(key, value.value)
|
40
|
+
end
|
41
|
+
puts model.output_as_json
|
42
|
+
model.quit if location
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'selenium_standalone_dsl'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module SeleniumSpider
|
5
|
+
class Model < SeleniumStandaloneDSL::Base
|
6
|
+
attr_accessor :attributes
|
7
|
+
@@attributes = {}
|
8
|
+
|
9
|
+
def initialize(location: nil, driver: nil)
|
10
|
+
if driver
|
11
|
+
@driver = driver
|
12
|
+
else
|
13
|
+
super()
|
14
|
+
visit location
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def set_attributes_value(key, value)
|
19
|
+
@@attributes[key].value = value
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.register(attr_name_sym)
|
23
|
+
@@attributes[attr_name_sym] = SeleniumSpider::Attribute.new
|
24
|
+
yield @@attributes[attr_name_sym] if block_given?
|
25
|
+
end
|
26
|
+
|
27
|
+
def extract(attr_name_sym)
|
28
|
+
attr = @@attributes[attr_name_sym]
|
29
|
+
return attr.value if attr.value
|
30
|
+
|
31
|
+
element_str = search(attr.css).inner_text
|
32
|
+
|
33
|
+
if attr.match &&(match = element_str.match(/#{attr.match}/))
|
34
|
+
element_str = match[match.length - 1]
|
35
|
+
end
|
36
|
+
|
37
|
+
if attr.sub
|
38
|
+
element_str = element_str.sub(/#{attr.sub[:replace]}/, attr.sub[:with])
|
39
|
+
end
|
40
|
+
|
41
|
+
if attr.lambda
|
42
|
+
element_str = attr.lambda.call(element_str)
|
43
|
+
end
|
44
|
+
|
45
|
+
element_str
|
46
|
+
end
|
47
|
+
|
48
|
+
def extract_all
|
49
|
+
extracted = {}
|
50
|
+
@@attributes.each do |key, value|
|
51
|
+
extracted[key] = extract(key)
|
52
|
+
end
|
53
|
+
extracted
|
54
|
+
end
|
55
|
+
|
56
|
+
# TODO: save to database(sqlite)
|
57
|
+
def save
|
58
|
+
end
|
59
|
+
|
60
|
+
def output_as_json
|
61
|
+
JSON.dump extract_all
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
class Attribute
|
66
|
+
attr_accessor :css, :match, :lambda, :sub, :value
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require "selenium_standalone_dsl"
|
2
|
+
|
3
|
+
module SeleniumSpider
|
4
|
+
class Pagination < SeleniumStandaloneDSL::Base
|
5
|
+
@@attributes = {}
|
6
|
+
|
7
|
+
def attributes
|
8
|
+
@@attributes
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.next_link(selector, find_by: :link_text)
|
12
|
+
@@next_link = selector
|
13
|
+
@@next_link_find_by = find_by
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.no_next_link
|
17
|
+
@@next_link = nil
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.detail_links(selector)
|
21
|
+
@@detail_links_selector = selector
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.no_detail_link
|
25
|
+
@@detail_links_selector = nil
|
26
|
+
end
|
27
|
+
|
28
|
+
def initialize(start_url)
|
29
|
+
super()
|
30
|
+
visit start_url
|
31
|
+
@uri = URI.parse(start_url)
|
32
|
+
end
|
33
|
+
|
34
|
+
# You can define something to do before crawling
|
35
|
+
def before_crawl(times)
|
36
|
+
end
|
37
|
+
|
38
|
+
def next
|
39
|
+
click @@next_link, find_by: @@next_link_find_by
|
40
|
+
end
|
41
|
+
|
42
|
+
def detail_links
|
43
|
+
return false if !@@detail_links_selector
|
44
|
+
search(@@detail_links_selector).map(&->(x) { full_url(x.attribute('href').value) } )
|
45
|
+
end
|
46
|
+
|
47
|
+
def full_url(path)
|
48
|
+
port = (@uri.port == 80) ? '' : ':' + @uri.port.to_s
|
49
|
+
@uri.scheme + '://' + @uri.host + port + path
|
50
|
+
end
|
51
|
+
|
52
|
+
def continue?
|
53
|
+
return false if !@@next_link
|
54
|
+
has_element?(@@next_link, find_by: @@next_link_find_by)
|
55
|
+
end
|
56
|
+
|
57
|
+
def register(attr_name_sym)
|
58
|
+
@@attributes[attr_name_sym] = SeleniumSpider::Attribute.new
|
59
|
+
yield @@attributes[attr_name_sym] if block_given?
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'selenium_spider/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "selenium_spider"
|
8
|
+
spec.version = SeleniumSpider::VERSION
|
9
|
+
spec.authors = ["gosho-kazuya"]
|
10
|
+
spec.email = ["ketsume0211@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Scrape websites using Firefox headlessly handled by Selenium}
|
13
|
+
spec.description = %q{Scrape websites using Firefox headlessly handled by Selenium}
|
14
|
+
spec.homepage = "https://github.com/acro5piano/selenium_spider"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
# if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
# else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
# end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
spec.bindir = "bin"
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
spec.required_ruby_version = '~> 2.3'
|
30
|
+
|
31
|
+
spec.add_runtime_dependency "selenium_standalone_dsl", "~> 0.1.2"
|
32
|
+
spec.add_runtime_dependency "activesupport"
|
33
|
+
spec.add_runtime_dependency "tilt"
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
38
|
+
spec.add_development_dependency "sinatra"
|
39
|
+
spec.add_development_dependency "pry"
|
40
|
+
spec.add_development_dependency "haml"
|
41
|
+
end
|
data/tmp/.gitkeep
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: selenium_spider
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- gosho-kazuya
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: selenium_standalone_dsl
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: tilt
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.12'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.12'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: sinatra
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: haml
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
description: Scrape websites using Firefox headlessly handled by Selenium
|
140
|
+
email:
|
141
|
+
- ketsume0211@gmail.com
|
142
|
+
executables: []
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files: []
|
145
|
+
files:
|
146
|
+
- ".gitignore"
|
147
|
+
- ".ruby-version"
|
148
|
+
- ".travis.yml"
|
149
|
+
- CODE_OF_CONDUCT.md
|
150
|
+
- Gemfile
|
151
|
+
- LICENSE
|
152
|
+
- README.md
|
153
|
+
- Rakefile
|
154
|
+
- bin/selenium-spider
|
155
|
+
- examples/controllers/yahoo_controller.rb
|
156
|
+
- examples/models/yahoo.rb
|
157
|
+
- examples/paginations/yahoo_pagination.rb
|
158
|
+
- lib/selenium_spider.rb
|
159
|
+
- lib/selenium_spider/command_line.rb
|
160
|
+
- lib/selenium_spider/controller.rb
|
161
|
+
- lib/selenium_spider/generations/controller.rb.erb
|
162
|
+
- lib/selenium_spider/generations/model.rb.erb
|
163
|
+
- lib/selenium_spider/generations/pagination.rb.erb
|
164
|
+
- lib/selenium_spider/model.rb
|
165
|
+
- lib/selenium_spider/pagination.rb
|
166
|
+
- lib/selenium_spider/version.rb
|
167
|
+
- selenium_spider.gemspec
|
168
|
+
- tmp/.gitkeep
|
169
|
+
homepage: https://github.com/acro5piano/selenium_spider
|
170
|
+
licenses:
|
171
|
+
- MIT
|
172
|
+
metadata: {}
|
173
|
+
post_install_message:
|
174
|
+
rdoc_options: []
|
175
|
+
require_paths:
|
176
|
+
- lib
|
177
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - "~>"
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '2.3'
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
|
+
requirements: []
|
188
|
+
rubyforge_project:
|
189
|
+
rubygems_version: 2.5.1
|
190
|
+
signing_key:
|
191
|
+
specification_version: 4
|
192
|
+
summary: Scrape websites using Firefox headlessly handled by Selenium
|
193
|
+
test_files: []
|