Bonjour à tous,
Sur ma page HTML, j'essaie de récupérer des informations qui se trouvent dans un tag SPAN :
[highlight]
' <span class="bigLabel">8129978</span>
' <span class="field">227-09-01  --  PECHES ET OCEANS</span>
[/code]
J'essaie avec le code suivant (comme je le ferai avec des tags "Input") mais sans succès :
	
	
	
	
	
		
J'ai beau chercher ce qui cloche, je ne trouve malheureusement rien 🙁
Sauriez-vous m'éclairer ? Merci de votre aide !!
	
		
			
		
		
	
				
			Sur ma page HTML, j'essaie de récupérer des informations qui se trouvent dans un tag SPAN :
[highlight]
' <span class="bigLabel">8129978</span>
' <span class="field">227-09-01  --  PECHES ET OCEANS</span>
[/code]
J'essaie avec le code suivant (comme je le ferai avec des tags "Input") mais sans succès :
		VB:
	
	
	Sub No_Demande_Client()
Dim Resultat As String
Dim appIE As Object             'InternetExplorer
Dim HTMLDoc As Object           'HTMLDocument
Dim oHTML_Element As Object     'IHTMLElement
Dim winShell As Object          'New ShellWindows
Set appIE = CreateObject("InternetExplorer.Application")
Set winShell = CreateObject("Shell.Application").Windows
    
' Recherche la bonne page
'
  For Each appIE In winShell
    If InStr(appIE.LocationURL, "TaskType") <> 0 Then
      appIE.Silent = True
      appIE.Visible = True
      Set HTMLDoc = appIE.document
      Resultat = HTMLDoc.documentElement.innerHTML
      Exit For
    End If
  Next appIE
    
For Each oHTML_Element In HTMLDoc.getElementsByTagName("span")
If oHTML_Element.Attribute("class") = "bigLabel" Then
'If oHTML_Element.Class = "bigLabel" Then
   ActiveSheet.Cells(2, 5).Value = oHTML_Element.Value
   End If
   
' mais il me faudrait seulement les 9 premiers caractères ("227-09-01")
If oHTML_Element.Attribute("class") = "field" Then
'If oHTML_Element.Class = "field" Then
   ActiveSheet.Cells(2, 15).Value = oHTML_Element.Value
   End If
Next oHTML_Element
End Sub
	J'ai beau chercher ce qui cloche, je ne trouve malheureusement rien 🙁
Sauriez-vous m'éclairer ? Merci de votre aide !!