Dim appIE As Object
Dim HTML_Body As Object, HTML_Tables As Object, MyTable As Object
Dim HTML_TableRows As Object
Dim RetVal As Variant, X As Integer
Dim GSatirSayisi As Integer
Const GLink As String = "https://www.canlialtinfiyatlari.com/"
Set appIE = CreateObject("internetexplorer.application")
With appIE
.Navigate GLink
.Visible = False
End With
Do While appIE.Busy: DoEvents: Loop
Set HTML_Body = appIE.Document.All
Set HTML_Tables = HTML_Body.tags("Table")
Set MyTable = HTML_Tables(2)
Set HTML_TableRows = MyTable.getElementsByTagName("tr")
GSatirSayisi = HTML_TableRows.Length - 1
ReDim Sorgu(3, GSatirSayisi - 1)
X = 0
For X = 0 To GSatirSayisi - 1
Sorgu(0, X) = MyTable.Rows(X + 1).Cells(0).innerText
Sorgu(1, X) = MyTable.Rows(X + 1).Cells(1).innerText
Sorgu(2, X) = MyTable.Rows(X + 1).Cells(2).innerText
Next X
Dim rc As DAO.Recordset
Set rc = CurrentDb.OpenRecordset("Tbl_Altin")
X = 0
For X = 0 To GSatirSayisi - 1
rc.AddNew
rc![AltınTuru] = Sorgu(0, X)
rc![Alis] = Sorgu(1, X)
rc![Satis] = Sorgu(2, X)
rc.Update
Next X
Set rc = Nothing
Me.Alt0.Requery
appIE.Quit
Set HTML_Body = Nothing
Set HTML_Tables = Nothing
Set MyTable = Nothing
Set HTML_TableRows = Nothing
Set appIE = Nothing
Butonun tıklandığında olayına aşağıdaki kodu ekle.