portal_scraper 1.5.0 → 1.6.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 +4 -4
- data/lib/portal_scraper/accounts/client.rb +15 -7
- data/lib/portal_scraper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a542aac9f217de2e57612d41dcea49244113a8bd5df4b4a75f68f3bbee929f3
|
4
|
+
data.tar.gz: 0a81730c139e278ec244b146262c4f20a0ab2541dbc560e6f9113641dcefafc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5878b31e717280e896190b54ec68992729123466c163f6829e9553b8cab5db31a4f73d6cff3b047377cb8c8321fcfa9614cad5a85d7a6f25b894f7001b22f44
|
7
|
+
data.tar.gz: 7e55493099947d44c3a7a0d73f2cd3713c228f8cdecbffd92e5495261d752554e759649c9865c0b397ad114bea5a461b21f3c985605a31bc1e91771ef1eb734d
|
@@ -20,13 +20,21 @@ module PortalScraper
|
|
20
20
|
def get_accounts_balance
|
21
21
|
login
|
22
22
|
accounts_data = { accounts: [] }
|
23
|
-
|
24
|
-
results.
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
|
24
|
+
results = app.post(url_for('/appRecherche.do'), { nom: '', prenom: '', chercher: 'Chercher' })
|
25
|
+
loop do
|
26
|
+
results.links_with(href: /appTiersDetail.do/).each do |link|
|
27
|
+
account = link.click
|
28
|
+
accounts_data[:accounts] << {
|
29
|
+
client_ref: find_table_value(account, 'Identifiant tiers'),
|
30
|
+
balance: account.search('table#contrat th.n').text.gsub(/[[:space:]]+/, '').tr('.,', ',.').to_f
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
break unless results.search('.pg_next').present?
|
35
|
+
# Need to fetch the first page as you cannot navigate from client back to research page
|
36
|
+
app.post(url_for('/appRecherche.do'), { nom: '', prenom: '', chercher: 'Chercher' })
|
37
|
+
results = app.get(results.search('a.pg_next').first['href'])
|
30
38
|
end
|
31
39
|
accounts_data
|
32
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portal_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Armand Mégrot
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-09-
|
12
|
+
date: 2019-09-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mechanize
|