- Katılım
- 3 Mart 2009
- Mesajlar
- 519
- Excel Vers. ve Dili
- excel 2003 tr
Kod:
Dim islem, URL As String
Dim ie As Object
Dim objCollection, objBtn, objLnk As Object
Sub bekle()
With ie
Do Until .readyState = 4: DoEvents: Loop
Do While .Busy: DoEvents: Loop
End With
End Sub
----------------------------------------------------------------------------------------------------------------------
Sub url_ac()
If InStr(GetIEWindows, "basvuru.tse.org.tr/uye/giris.jsp") <= 0 Then
URL = "basvuru.tse.org.tr/uye/giris.jsp"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Navigate URL
.Visible = 1
'.ShowWindow ie.hwnd, 6
End With
End If
Call bekle
Set objCollection = ie.Document.getElementsByTagName("input")
'Kutulara şifre ve k.adı giriliyor
i = 0
Do While i < objCollection.Length
If objCollection(i).ID = "j_username" Then
objCollection(i).Value = Cells(1, "B").Value
End If
If objCollection(i).ID = "j_password" Then
objCollection(i).Value = Cells(2, "B").Value
'Exit Do
End If
i = i + 1
Loop
Call bekle
Set objBtn = ie.Document.getElementsByTagName("button")
'Giriş tuşuna basılıyor
a = 0
Do While a < objBtn.Length
If objBtn(a).ID = "loginBtn" Then
objBtn.Item(a).Click
Exit Do
End If
a = a + 1
Loop
Call bekle
Application.Wait Now + TimeSerial(0, 0, 1)
Set objLnk = ie.Document.getElementsByTagName("a")
End Sub
Buraya kadar sorun yok
Ancak : URL = "basvuru.tse.org.tr/uye/giris.jsp" linki URL = "basvuru.tse.org.tr/uye/index.jsp" ; giris, index olarak değişince işlem duruyor ve değişen sayfada işlem yapamıyorum. yeniden yükleme yaptığımda ise şifre iptal edilmiş olduğundan URL = "basvuru.tse.org.tr/uye/index.jsp sayfasına devam etmiyor bunu nasıl aşabilirim şimdiden teşekkürler.
