Saltar al contenido

Macro extraer mails de pagina web


Recommended Posts

publicado

Buenas noches,

Estoy intentando utilizar esta macro pero no me responde y desconozco porqué.

Además el navegador que uso suele ser chrome. ¿Alguien puede ayudarme a saber porque no se ejecuta bien?

Gracias

adjunto código

---

Sub scrapeHyperlinksWebsite()

Dim ie As InternetExplorer

Dim html As HTMLDocument

Dim Link As Object

Dim ElementCol As Object

Dim erow As Long

Application.ScreenUpdating = False

Set ie = New InternetExplorer

ie.Visible = False

‘ie.navigate “http://www.rondebruin.nl/contact.htm”

‘ie.navigate “http://info.mathxlforschool.com/contact-us”

ie.navigate “http://www.iberia.es”

Do While ie.readyState <> READYSTATE_COMPLETE

Application.StatusBar = “Loading website…”

DoEvents

Loop

Set html = ie.document

‘Range(“A2″) = html.DocumentElement.innerHTML

Set ElementCol = html.getElementsByTagName(“a”)

‘Set ElementCol = html.getElementsByTagName(“mailto:”)

For Each Link In ElementCol

If InStr(Link, “mailto:”) Then

erow = Worksheets(“Sheet1″).Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

Cells(erow, 1).Value = Link

Cells(erow, 1) = Right(Link, Len(Link) – InStr(Link, “:”))Cells(erow, 1).Columns.AutoFit

End If

Next

Set ie = Nothing

Application.StatusBar = “”

Application.ScreenUpdating = True

End Sub

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

×
×
  • Crear nuevo...

Información importante

Echa un vistazo a nuestra política de cookies para ayudarte a tener una mejor experiencia de navegación. Puedes ajustar aquí la configuración. Pulsa el botón Aceptar, si estás de acuerdo.