• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Açık Web Sayfalarından İstenilen Sayfadan Veri Çekme

  • Konbuyu başlatan Konbuyu başlatan askm
  • Başlangıç tarihi Başlangıç tarihi

askm

Destek Ekibi
Destek Ekibi
Katılım
4 Haziran 2005
Mesajlar
2,746
Excel Vers. ve Dili
2010-2016
Kolay gelsin. ie ile veri çekmede 3-4 tane sayfa açık ise ben bunlardan dilediğimden veri çekmek istersem nasıl yapabilirim. Yani ie navigate olayını atlayıp açık sayfalardan html takında like elitform varsa veri çek gibi olabilir mi?

Set uygulama = CreateObject("Shell.Application")
For Each nesne In uygulama.Windows

ile ie sayfaları arasında geziniyor. Bu sayfanın html tagında ya da başka bir class - tag name içerisinde aradığım veri varsa oradaki sayfa kodlarını al gibi.
 
Bu kodu bir dene bu kod ile
https://www.excel.web.tr/
veb sitesindeki buttonlara ait isimleri alıyor


Rich (BB code):
Sub deneme()

Dim objShell As Object
Dim IE As Object
Set objShell = CreateObject("Shell.Application").Windows
If objShell.Count > 0 Then
For Each IE In objShell

With IE
If .LocationURL = "https://www.excel.web.tr/" Then

MsgBox .LocationURL
Set botoes = IE.document.getElementsByTagName("button")
For Each bt In botoes
MsgBox bt.innerText
Next

End If
End With
Next IE
End If
End Sub
 
bu kod da
https://www.excel.web.tr/
veb sitesindeki görünen açık konuları gösteriyor

Rich (BB code):
Sub deneme()

Dim objShell As Object
Dim IE As Object
Set objShell = CreateObject("Shell.Application").Windows
If objShell.Count > 0 Then
For Each IE In objShell

With IE

If .LocationURL = "https://www.excel.web.tr/" Then
MsgBox .LocationURL
Set botoes = IE.document.getElementsByTagName("a")
For Each bt In botoes
If bt.Title <> "" Then
MsgBox bt.Title
End If
Next
End If

End With

Next IE
End If
End Sub
 
Sayın Halit Bey ilginiz ve yardımınız için çok teşekkür ederim.
Kodları aşağıdaki şekilde değiştirerek işlemi hallettim sanırım.
Yarın asıl dosyada deneyeceğim.
Allah razı olsun.

Kod:
Sub deneme2()

Dim objShell As Object
Dim IE As Object
Set objShell = CreateObject("Shell.Application").Windows
If objShell.Count > 0 Then
For Each IE In objShell
With IE
If .LocationURL = "https://www.excel.web.tr/" Then
MsgBox .LocationURL
If IE.Document.DocumentElement.innerhtml Like "*elit*" Then
    Set botoes = IE.Document.getElementsByTagName("a")
    For Each bt In botoes
        If bt.Title <> "" Then
            a = a + 1
            Cells(a, 2) = bt.innertext
        End If
    Next
IE.Quit
End If
End If
End With
Next IE
End If
End Sub
 
Geri
Üst