bon me voila revenu
alors ce derniers code ??
Version imprimable
bon me voila revenu
alors ce derniers code ??
Tu n'as pas trop mal aux bras ??? :ptdr:
Le dernier code ajoute bien la BNP et retire le signe euro ! Nickel.
Si j'ai bien compris, il n'est pas possible d'enlever la ligne mentionnant le total des comptes épargne ? C'est ça ?
si !!si tu veux on le retire
Avec plaisir :-)
voila plus de comptes épargnes
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 Sub tablobanqueexa() Dim tablo, tablo2(500, 3) Dim laChaine As String, x, fichier As String, donnée As String tablo2(0, 0) = "type de compte": tablo2(0, 1) = "banque": tablo2(0, 2) = "Solde" fichier = ThisWorkbook.Path & "\testexa.txt" x = FreeFile Open fichier For Input As #x laChaine = Input(LOF(x), #x) Close #x laChaine = Replace(laChaine, "BNP Multiplacements 2", "il y a *" & "BNP Multiplacements 2") laChaine = Replace(Replace(Replace(Split(Split(laChaine, "Tous mes comptes")(1), "Mes notifications")(0), "heures", "*"), "jours", "*"), "hier", "*") tablo = Split(laChaine, vbCrLf) For i = 0 To UBound(tablo) If InStr(tablo(i), "il y a ") > 0 Then If Not Split(tablo(i), "*")(1) Like "" Then a = a + 1 tablo2(a, 0) = Split(tablo(i), "*")(1) donnée = tablo(i + 1) tablo2(a, 1) = Split(nom_ou_solde(donnée, "[0-9]"), ",")(0) tablo2(a, 2) = nom_ou_solde(donnée, "[a-z-A-Z|é|'|\(|\)|]") End If End If Next Sheets(1).Cells(1, 1).Resize(a, 3) = tablo2 End Sub Function nom_ou_solde(donnée, matrice) With CreateObject("VBScript.RegExp") .Global = True '.IgnoreCase = True .Pattern = matrice nom_ou_solde = .Replace(donnée, "") End With End Function
Wawwwwwwwwwwwwwwwwwwwwwwwwwww
Je suis juste un peu déçue !
Tu m'as dit que le problème de Seb t'avait tenu en haleine pendant 3 mois !
Et pour moi, cela n'a pris que 8 jours...
J'aurais préféré t'occuper plus longtemps :?
il y a d'autre moyen de m'occuper je les aimes aussi en poires :ptdr:
bon alors c'est bon on tente avec la page web directement maintenant ??
ou tu saura te débrouiller ??
Mdrrrrrrrrrrrrrrrrr !
Euhhh on tente avec la page web directement maintenant. Comme ça je suis certaine que le boulot sera bien fait :lol:
bon ben voila
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 Option Explicit Sub test5() Dim url As String, ie As Object, tabloBanque(5000, 2), code As String, l As Long, banque, i As Long, r As Long url = "https://wwws.linxo.com/auth.page#Login" Set ie = CreateObject("internetexplorer.application") With ie .Visible = True .navigate url Do: DoEvents: Loop While .readystate <> 4 Or .busy ' test si tu es deja loguée If .LOCATIONURL = url Then Application.Wait (Now + TimeValue("0:00:01")) .document.all("username").innertext = "monlogin" 'ADAPTE TON LOGIN .document.all("Password").innertext = "motdepasse" 'ADAPTE TON MOT DE PASSE .document.getelementsbytagname("BUTTON")(0).Click End If Do: DoEvents: Loop While .readystate <> 4 Or .busy Do: l = l + 1: DoEvents: Loop Until .LOCATIONURL <> url Or l = 30000 laChaine = .document.body.innertext .Quit End With laChaine = Replace(laChaine, "BNP Multiplacements 2", "il y a *" & "BNP Multiplacements 2") laChaine = Replace(Replace(Replace(Split(Split(laChaine, "Tous mes comptes")(1), "Mes notifications")(0), "heures", "*"), "jours", "*"), "hier", "*") tablo = Split(laChaine, vbCrLf) For i = 0 To UBound(tablo) If InStr(tablo(i), "il y a ") > 0 Then If Not Split(tablo(i), "*")(1) Like "" Then a = a + 1 tablo2(a, 0) = Split(tablo(i), "*")(1) donnée = tablo(i + 1) tablo2(a, 1) = Split(nom_ou_solde(donnée, "[0-9]"), ",")(0) tablo2(a, 2) = CDec(nom_ou_solde(donnée, "[a-z-A-Z|é|'|\(|\)|]")) End If End If Next Sheets(1).Cells(1, 1).Resize(a, 3) = tablo2 End Sub Function nom_ou_solde(donnée, matrice) With CreateObject("VBScript.RegExp") .Global = True '.IgnoreCase = True .Pattern = matrice nom_ou_solde = .Replace(donnée, "") End With End Function
La variable "lachaine" n'est pas définie. Comment dois-je la déclarer ?
hoh!!! ta pas retenu encore ?????!!!!
Code:dim lachaine as string
J'ai donc "tablo", "tablo2" et "a" en variables non déclarées.
Oui je l'avais mis en string entre-temps lol.
Mais concernant "tablo" et "tablo2" ?
voila
je m'absente je vais manger chez la voisine se soir ;)Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 Option Explicit Sub test5() Dim url As String, ie As Object, tablo2(5000, 3), laChaine As String, l As Long, tablo, i As Long, a As Long, donnée As String url = "https://wwws.linxo.com/auth.page#Login" Set ie = CreateObject("internetexplorer.application") With ie .Visible = True .navigate url Do: DoEvents: Loop While .readystate <> 4 Or .busy ' test si tu es deja loguée If .LOCATIONURL = url Then Application.Wait (Now + TimeValue("0:00:01")) .document.all("username").innertext = "monlogin" 'ADAPTE TON LOGIN .document.all("Password").innertext = "motdepasse" 'ADAPTE TON MOT DE PASSE .document.getelementsbytagname("BUTTON")(0).Click End If Do: DoEvents: Loop While .readystate <> 4 Or .busy Do: l = l + 1: DoEvents: Loop Until .LOCATIONURL <> url Or l = 30000 laChaine = .document.body.innertext .Quit End With laChaine = Replace(laChaine, "BNP Multiplacements 2", "il y a *" & "BNP Multiplacements 2") laChaine = Replace(Replace(Replace(Split(Split(laChaine, "Tous mes comptes")(1), "Mes notifications")(0), "heures", "*"), "jours", "*"), "hier", "*") tablo = Split(laChaine, vbCrLf) For i = 0 To UBound(tablo) If InStr(tablo(i), "il y a ") > 0 Then If Not Split(tablo(i), "*")(1) Like "" Then a = a + 1 tablo2(a, 0) = Split(tablo(i), "*")(1) donnée = tablo(i + 1) tablo2(a, 1) = Split(nom_ou_solde(donnée, "[0-9]"), ",")(0) tablo2(a, 2) = CDec(nom_ou_solde(donnée, "[a-z-A-Z|é|'|\(|\)|]")) End If End If Next Sheets(1).Cells(1, 1).Resize(a, 3) = tablo2 End Sub Function nom_ou_solde(donnée, matrice) With CreateObject("VBScript.RegExp") .Global = True '.IgnoreCase = True .Pattern = matrice nom_ou_solde = .Replace(donnée, "") End With End Function
Mdrrrrr en poire ??? ^^
2 erreurs :
Erreur définie par l'application ou par l'objet. (en mode pas à pas)
Dans cette boucle là :
L'indice n'appartient pas à la sélection ! (en mode normal)Code:If Not Split(tablo(i), "*")(1) Like "" Then
a bon cela voudrais dire que aujourd'hui il y a pas comptes d'epargne dans le texte ??????
fait le fichier avec l'ancien pour verifier
j'ai encore un moment c'est pas cuit encore
Alors en fait, j'ai l'impression que le code défile trop vite !
Car quand je passe en mode Pas à pas avec F8 et en prenant vraiment mon temps pour presser F8, il y a seulement l'erreur "L'indice n'appartient pas à la sélection "
Ici :Code:If Not Split(tablo(i), "*")(1) Like "" Then
j'ai enlever la condition comptes epargnes dis moi si ca fonctionne
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 Option Explicit Sub test5() Dim url As String, ie As Object, tablo2(5000, 3), laChaine As String, l As Long, tablo, i As Long, a As Long, donnée As String url = "<a href="https://wwws.linxo.com/auth.page#Login" target="_blank">https://wwws.linxo.com/auth.page#Login</a>" Set ie = CreateObject("internetexplorer.application") With ie .Visible = True .navigate url Do: DoEvents: Loop While .readystate <> 4 Or .busy ' test si tu es deja loguée If .LOCATIONURL = url Then Application.Wait (Now + TimeValue("0:00:01")) .document.all("username").innertext = "monlogin" 'ADAPTE TON LOGIN .document.all("Password").innertext = "motdepasse" 'ADAPTE TON MOT DE PASSE .document.getelementsbytagname("BUTTON")(0).Click End If Do: DoEvents: Loop While .readystate <> 4 Or .busy Do: l = l + 1: DoEvents: Loop Until .LOCATIONURL <> url Or l = 30000 laChaine = .document.body.innertext .Quit End With laChaine = Replace(laChaine, "BNP Multiplacements 2", "il y a *" & "BNP Multiplacements 2") laChaine = Replace(Replace(Replace(Split(Split(laChaine, "Tous mes comptes")(1), "Mes notifications")(0), "heures", "*"), "jours", "*"), "hier", "*") tablo = Split(laChaine, vbCrLf) For i = 0 To UBound(tablo) If InStr(tablo(i), "il y a ") > 0 Then a = a + 1 tablo2(a, 0) = Split(tablo(i), "*")(1) donnée = tablo(i + 1) tablo2(a, 1) = Split(nom_ou_solde(donnée, "[0-9]"), ",")(0) tablo2(a, 2) = CDec(nom_ou_solde(donnée, "[a-z-A-Z|é|'|\(|\)|]")) End If Next Sheets(1).Cells(1, 1).Resize(a, 3) = tablo2 End Sub Function nom_ou_solde(donnée, matrice) With CreateObject("VBScript.RegExp") .Global = True '.IgnoreCase = True .Pattern = matrice nom_ou_solde = .Replace(donnée, "") End With End Function
Même erreur.
J'avais déclaré la variable. Je ne me suis pas trompée par hasard ???Code:a As long
Salut a tous,
C un site de rencontre ici....:fessee:
Je vois que vous vous éclatez bien; le regexp quand tu nous tiens.....
Et pour répondre, le physique n'est qu'une apparence, le plus beau est à l'intérieur.....;)
Patrick, tu as passé tellement de temps avec mon sujet, que maintenant tu est blindé.....tu vois Hexa....:mouarf:
D'ailleurs en passant, j'ai un truc à te proposer Patrick.....mais pas ici
Bonne soirée à tous
Et profite bien de la voisine....Lolllll :pastaper:
Hexa, selon comment Patrick, va rentrer il va te pondre un code de ouffffff......l'inspiration quand tu nous tiens
Namasté,
SEB
Mdrrr. Tout dépend de la nature de sa rencontre avec la voisine ^^
En même temps, à force de parler de "string" et de "long" dans ces codes, il fallait bien qu'il passe à la pratique :ptdr: