¿Cómo obtiene vb el código fuente de la página web actualmente abierta en IE?
Luego copie el siguiente código en el área de código,
Después de ejecutarlo, puede El código fuente de la página web abierta en IE se muestra en tiempo real en texto1:
Opción explícita
Dim oShellAppWindows, oWin
Cómo obtener el código fuente de la página web abierta en el código fuente de IE? p>Opción explícita
Atenuar oShellApp, oShellAppWindows, oWin
Atenuar UrlLst como cadena
Private Sub Timer1_Timer()
Establecer oShellApp = CreateObject("Shell.Application")
Establezca oShellAppWindows = oShellApp.Windows
para cada oWin en oShellAppWindows
si LCase(TypeName(oWin.document)) = "htmldocument" Entonces
Si InStr(1, UrlLst, oWin.locationurl, vbTextCompare) = 0 entonces
UrlLst = UrlLst & oWin.locationurlamp & ","
Text1.Text = oWin.document.body.innerHTML
Me.Caption = oWin.locationname
Finalizar si
Finalizar si
Siguiente
Fin Sub