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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
| Sub Go_Traitement_WinHttpRequest()
'Call ajout_site_de_confiance
Const HTTPREQUEST_PROXYSETTING_DEFAULT = 0
Const HTTPREQUEST_PROXYSETTING_PRECONFIG = 0
Const HTTPREQUEST_PROXYSETTING_DIRECT = 1
Const HTTPREQUEST_PROXYSETTING_PROXY = 2
sirens = Array(813023868, 813156973, 813157476, 813622552, 813837507, 813986635, 814095113, 814279881, 814406989, 817727571, 818756991, 818993800, 819058124, 819130758, 819132135, 819253956, 886180694, 950516047, 957504061, 962227351)
Dim i, j, k, l, elements, SP As String
Dim htmlTabElement() As IHTMLElement
Dim GenericElem As HTMLGenericElement
Dim MyTags
Dim MonDiv As HTMLDivElement
Dim VERIF_siren
' selection des contacts
Dim URLSTE, Titre As String, donnée_brut, donnée_propre
' Set MyXMLHttp = CreateObject("Microsoft.XMLHTTP")
'Set MyXMLHttp = CreateObject("Msxml2.XMLHTTP")
Set oRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
Dim t0 As Double
t0 = Time
verrouEvent = True
For Each contact In sirens
mySIREN = contact
URL$ = "https://www.ellisphere.fr/entreprise/" & mySIREN
On Error GoTo suivant
With oRequest
.Open "GET", URL, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"
.setProxy HTTPREQUEST_PROXYSETTING_PROXY, "10.15.0.10:80"
.Option(6) = True 'Pour autoriser la redirection
.Option(12) = True 'Pour autoriser la redirection HTTPS to HTTP
.send '"{range:9129370}"
.WaitForResponse
On Error Resume Next
On Error GoTo 0
If .Status = 200 Then
SP = .responseText
' If InStr(1, SP, "app.entreprise = app.entreprise || {};", vbTextCompare) Then
' 'Call EXTRACT_DONNEES(SP)
' Call EXTRACT_DONNEES_JSON_Contacts(SP, contact)
' End If
End If
End With
On Error GoTo 0
suivant:
Next contact
Debug.Print "WinHttpRequest" & vbTab & UBound(sirens) & vbTab & CStr(Time - t0)
MsgBox CStr(Time - t0)
End Sub
Sub Go_Traitement_Msxml2XMLHTTP()
sirens = Array(813023868, 813156973, 813157476, 813622552, 813837507, 813986635, 814095113, 814279881, 814406989, 817727571, 818756991, 818993800, 819058124, 819130758, 819132135, 819253956, 886180694, 950516047, 957504061, 962227351)
Dim i, j, k, l, elements, SP As String
Dim htmlTabElement() As IHTMLElement
Dim GenericElem As HTMLGenericElement
Dim MyTags
Dim MonDiv As HTMLDivElement
Dim VERIF_siren
' selection des contacts
Dim URLSTE, Titre As String, donnée_brut, donnée_propre
' Set MyXMLHttp = CreateObject("Microsoft.XMLHTTP")
Set MyXMLHttp = CreateObject("Msxml2.XMLHTTP")
Dim t0 As Double
t0 = Time
verrouEvent = True
For Each contact In sirens
mySIREN = contact
URL$ = "https://www.ellisphere.fr/entreprise/" & mySIREN
With MyXMLHttp
.Open "get", URL, False
.setRequestHeader "DNT", "1"
On Error Resume Next
.send
On Error GoTo 0
If .Status = 200 Then
SP = .responseText
' If InStr(1, SP, "app.entreprise = app.entreprise || {};", vbTextCompare) Then
' 'Call EXTRACT_DONNEES(SP)
' Call EXTRACT_DONNEES_JSON_Contacts(SP, contact)
' End If
End If
End With
On Error GoTo 0
suivant:
Next contact
Debug.Print "Msxml2XMLHTTP" & vbTab & UBound(sirens) & vbTab & CStr(Time - t0)
MsgBox CStr(Time - t0)
End Sub
Sub Go_Traitement_Msxml2ServerXMLHTTP60()
sirens = Array(813023868, 813156973, 813157476, 813622552, 813837507, 813986635, 814095113, 814279881, 814406989, 817727571, 818756991, 818993800, 819058124, 819130758, 819132135, 819253956, 886180694, 950516047, 957504061, 962227351)
Dim i, j, k, l, elements, SP As String
Dim htmlTabElement() As IHTMLElement
Dim GenericElem As HTMLGenericElement
Dim MyTags
Dim MonDiv As HTMLDivElement
Dim VERIF_siren
' selection des contacts
Dim URLSTE, Titre As String, donnée_brut, donnée_propre
Set MyXMLHttp = CreateObject("Msxml2.ServerXMLHTTP.6.0")
Dim t0 As Double
t0 = Time
verrouEvent = True
For Each contact In sirens
mySIREN = contact
URL$ = "https://www.ellisphere.fr/entreprise/" & mySIREN
MyXMLHttp.setProxy 2, "10.15.0.10:80", ""
MyXMLHttp.Open "GET", URL$, False
MyXMLHttp.send
While MyXMLHttp.Status Like "3##"
MyXMLHttp.Open "GET", MyXMLHttp.getResponseHeader("Location"), False
MyXMLHttp.send
Wend
SP = MyXMLHttp.responseText
On Error GoTo 0
suivant:
Next contact
Debug.Print "Msxml2ServerXMLHTTP60" & vbTab & UBound(sirens) + 1 & vbTab & CStr(Time - t0)
MsgBox CStr(Time - t0)
End Sub |
Partager