• DİKKAT

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

WEB'DE TUŞ YOKSA ATLAMA

  • Konbuyu başlatan Konbuyu başlatan Kusta
  • Başlangıç tarihi Başlangıç tarihi
Katılım
30 Kasım 2018
Mesajlar
94
Excel Vers. ve Dili
2016
Üstadlar kolay gelsin,
Excell'de veri yoksa aşağıdaki formülle uyarı verdirebiliyorum;

son = Cells(Rows.Count, "A").End(3).Row
For i = 2 To son
If Cells(i, "A") = "" Then
Cells(i, "C") = "Ne verdin ki ne alasın!!!"
Else

Ancak internetten veri alıyorum ve bir yerde "click" yaptırıyorum. Ancak bazılarında bu tuş olmadığından "click" yapmıyor ve hata veriyor. Eğer o tuş yoksa geç nasıl yapabilirim.


Formülün ilgili kısmı bu şekilde,

Set TrackID = IE.document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1")
IE.document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1").Click
IE.Visible = False
While IE.Busy
DoEvents
Wend
 
Kod:
    If IsObject(IE.Document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1")) Then
        IE.Document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1").Click
    End If
 
Kod:
    If IsObject(IE.Document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1")) Then
        IE.Document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1").Click
    End If

Malesef yine hata veriyor. Kodun tamamı aşağıda. Sizin dediğiniz gibi de ekledim. Yeşil olan yer. Hata nerde olabilir.

Sub _Arama()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
Application.Wait Now + TimeValue("00:00:02")
IE.Navigate "https://deneme.aspx"
Application.Wait Now + TimeValue("00:00:02")
IE.Width = 1500
IE.Height = 1000
IE.Visible = True
While IE.Busy
DoEvents
Wend
son = Cells(Rows.Count, "A").End(3).Row
For i = 2 To son
If Cells(i, "A") = "" Then
Cells(i, "C") = "Ne verdin ki ne alasın!!!"
Else

IE.Document.getElementById("ctl04_ctldenemeO").Value = Cells(i, "A")
IE.Visible = True
While IE.Busy
DoEvents
Wend

Set TrackID = IE.Document.getElementById("ctl04_ctlPageCommand_CommandItem_Search")
IE.Document.getElementById("ctl04_ctlPageCommand_CommandItem_Search").Click
IE.Visible = True
While IE.Busy
DoEvents
Wend
Set TrackID = IE.Document.getElementById("ctl04_ctlGrid_ctl02_LinkButton1")
IE.Document.getElementById("ctl04_ctlGrid_ctl02_LinkButton1").Click
IE.Visible = True
While IE.Busy
DoEvents
Wend
Set TrackID = IE.Document.getElementById("ctl04_ctlPageCommand_CommandItem_SeeDetail")
IE.Document.getElementById("ctl04_ctlPageCommand_CommandItem_SeeDetail").Click
IE.Visible = True
While IE.Busy
Wend
Set TrackID = IE.Document.getElementById("ctl02_ctl21_İletişim Bilgileri")
IE.Document.getElementById("ctl02_ctl21_İletişim Bilgileri").Click
IE.Visible = True
While IE.Busy
Wend

If IsObject(IE.Document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1")) Then
IE.Document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1").Click
End If
IE.Visible = True
While IE.Busy
DoEvents

Wend
Cells(i, "B") = IE.Document.getElementById("ctl02_ctlIletisimBilgi").Value
IE.Visible = True
While IE.Busy
DoEvents
Wend
With IE
.Visible = True
.GoBack
.GoBack
.GoBack
End With
While IE.Busy
DoEvents
Wend
End If
Next
IE.Quit
End Sub
 
Arkadaşlar yardımlarınızı bekliyorum. Çözemedim ve acil bir konu.
 
Konu güncel arkadaşlar. bu ( "ctl02_ctlGridIletisim_ctl02_LinkButton1" ) Id olsada olmasada click yapmaya çalışıyor. varsa tamam sorun yok ama bu ID yoksa hata veriyor.

Aşağıdaki koddaki hata nerde olabilir.

If IsObject(IE.Document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1")) Then
IE.Document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1").Click
End If
 
Şöyle olabilir mi?

Kod:
On Error Resume Next 
IE.document.getElementById("ctl02_ctlGridIletisim_ctl02_LinkButton1").Click
On Error GoTo 0
 
Geri
Üst