transportscrapper 0.0.2 → 0.0.3
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 +4 -4
- data/lib/TransportScrapper.rb +9 -13
- 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: 65a51a8d84ca9db35a6b5fa9dc3e44fb99e2cf8d9eedf89d9554361d974254e0
|
|
4
|
+
data.tar.gz: 43ac96e129debce9d0acfee25a0b5473353aa7f575fcde4ebe8732526a86a06a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c35d7e0c1f3b6ba6df4403c120550047854c0e34eb84e9b918c5f750a250dab7db03cbfe13ac6f49c3f415e5210d5edf0eb20e83b380b2ee555b0a64048ef38e
|
|
7
|
+
data.tar.gz: f8af164ae2f029f0a6bb4ace21670e508e523ad964fad03fe5205fd19324ee42498f152ed164aad3ecc2fe9fb55759ddea78d198db26526f08e1dae03f2d073d
|
data/lib/TransportScrapper.rb
CHANGED
|
@@ -3,15 +3,6 @@ require 'watir'
|
|
|
3
3
|
|
|
4
4
|
class TransportScrapper
|
|
5
5
|
|
|
6
|
-
args = %w[--disable-infobars --headless window-size=1600,1200 --no-sandbox --disable-gpu --disable-dev-shm-usage]
|
|
7
|
-
options = {
|
|
8
|
-
binary: ENV['GOOGLE_CHROME_BIN'],
|
|
9
|
-
prefs: { password_manager_enable: false, credentials_enable_service: false },
|
|
10
|
-
args: args
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@browser = Watir::Browser.new(:chrome, options: options)
|
|
14
|
-
|
|
15
6
|
@outwardArr = []
|
|
16
7
|
@returnArr = []
|
|
17
8
|
|
|
@@ -121,6 +112,15 @@ end
|
|
|
121
112
|
|
|
122
113
|
def self.scrape(value)
|
|
123
114
|
|
|
115
|
+
args = %w[--disable-infobars --headless window-size=1600,1200 --no-sandbox --disable-gpu --disable-dev-shm-usage]
|
|
116
|
+
options = {
|
|
117
|
+
binary: ENV['GOOGLE_CHROME_BIN'],
|
|
118
|
+
prefs: { password_manager_enable: false, credentials_enable_service: false },
|
|
119
|
+
args: args
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@browser = Watir::Browser.new(:chrome, options: options)
|
|
123
|
+
|
|
124
124
|
timeArr = ["0000","0400","0800","1200","1600","2000"]
|
|
125
125
|
|
|
126
126
|
for time in timeArr do
|
|
@@ -140,9 +140,5 @@ return result
|
|
|
140
140
|
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
-
value ='https://national.buseireann.ie/?originStop=13500&destinationstop=55504&ticketType=2&departdate=27-nov-2019&returndate=27-nov-2019&adult=1&child=0&student=0&family=0'
|
|
144
|
-
|
|
145
|
-
res = TransportScrapper.scrape(value)
|
|
146
|
-
puts res
|
|
147
143
|
end
|
|
148
144
|
|