rakuten_securities_scraper 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/README.md +14 -3
- data/lib/rakuten_securities_scraper.rb +5 -0
- data/lib/rakuten_securities_scraper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bda3af5dc3b21c8c6ec54d33c5893400f7164df75a7eeaf6ab768ce314e0ade
|
4
|
+
data.tar.gz: 2c21e09bc510161f97ee42fb144545cafa9d630f647cdfb945c057049cf9851d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be780e7e99a503791fb907e0d006b2923c6958827a12e6e33abbff08d79199a2ba7c01865c02f4c1a3620a8af155989b2df8e54488c60d666410e9d96a18f817
|
7
|
+
data.tar.gz: 95d8916aea0f264a536fefbc5349c83d7f34fb9d5bb114907ca4eed3557a829367204b14f5cb08573b0637ee62b41ee45dfc272420ff1b9e110d7f96d46e1f3d
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem
|
12
|
+
gem "rakuten_securities_scraper"
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -22,7 +22,18 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
ruby```
|
26
|
+
include RakutenSecuritiesScraper
|
27
|
+
data = RakutenScraper.new($LOGIN_ID, $LOGIN_PW)
|
28
|
+
|
29
|
+
|
30
|
+
## Get Today's Trade History
|
31
|
+
data.todays_history
|
32
|
+
|
33
|
+
## Get All Trade History
|
34
|
+
data.all_history
|
35
|
+
|
36
|
+
```
|
26
37
|
|
27
38
|
## Development
|
28
39
|
|
@@ -32,5 +43,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
43
|
|
33
44
|
## Contributing
|
34
45
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
46
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/elsoul/rakuten_securities_scraper.
|
36
47
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "rakuten_securities_scraper/version"
|
2
|
+
require "selenium-webdriver"
|
2
3
|
|
3
4
|
module RakutenSecuritiesScraper
|
4
5
|
class Error < StandardError; end
|
@@ -32,6 +33,8 @@ module RakutenSecuritiesScraper
|
|
32
33
|
rows = driver.find_elements(xpath: "//tr")
|
33
34
|
page_num = rows[8].text.scan(/(.+)件中/)[0][0].to_i
|
34
35
|
trade_table_data driver, page_num
|
36
|
+
ensure
|
37
|
+
driver.quit
|
35
38
|
end
|
36
39
|
|
37
40
|
def todays_history
|
@@ -56,6 +59,8 @@ module RakutenSecuritiesScraper
|
|
56
59
|
return "no data"
|
57
60
|
end
|
58
61
|
trade_table_data driver, page_num
|
62
|
+
ensure
|
63
|
+
driver.quit
|
59
64
|
end
|
60
65
|
|
61
66
|
def trade_table_data driver, page_num
|