Merhaba arkadaşlar. kelime öğrenme uygulamama kolay şekilde kelime atabilmek için bir kod yazmaya çalışıyorum. Xpath yolu ile veriyi çekebiliyorum ama ben bylass yöntemi ile çekmek istiyorum. ne yaparsam yapayım kodu çalıştıramadım. bu konuda yardımcı olabilirseniz sevinirim.
Private Sub CommandButton1_Click()
Dim Mydoc As New Selenium.WebDriver
Dim TX As String
Dim i As Integer
dolu = WorksheetFunction.CountA(Range("A1:A250"))
Mydoc.Start "chrome"
For i = 1 To dolu Step 1
TX = Range("A" & i).Value
x1 = "/" & TX
On Error Resume Next
Mydoc.Get "https://dictionary.cambridge.org/dictionary/english-turkish" & x1
xs = ""
xt = ""
xu = ""
''------------------------
Set xs = Mydoc.FindElementByClass("def-head ddef_h")
Set xt = Mydoc.FindElementByCss(".def-head ddef_h")
''Set xs = Mydoc.FindElementByXPath("/html/body/div[2]/div/div[1]/div[2]/article/div[2]/div[2]/div[3]/div/div/div[3]/div[1]/div[2]/div/div[3]/div[1]")
''Set xt = Mydoc.FindElementByXPath("/html/body/div[2]/div/div[1]/div[2]/article/div[2]/div[2]/div[3]/div/div/div[3]/div[1]/div[2]/div/div[3]/span")
''Set xu = Mydoc.FindElementByXPath("/html/body/div[2]/div/div[1]/div[2]/article/div[2]/div[2]/div[3]/div/div/div[3]/div[2]/div[2]/div/div[3]/span")
xs = xs.Text
xt = xt.Text
xu = xu.Text
Range("B" & i).Value = xs
Range("C" & i).Value = xt
Range("D" & i).Value = xu
Next
End Sub
Private Sub CommandButton1_Click()
Dim Mydoc As New Selenium.WebDriver
Dim TX As String
Dim i As Integer
dolu = WorksheetFunction.CountA(Range("A1:A250"))
Mydoc.Start "chrome"
For i = 1 To dolu Step 1
TX = Range("A" & i).Value
x1 = "/" & TX
On Error Resume Next
Mydoc.Get "https://dictionary.cambridge.org/dictionary/english-turkish" & x1
xs = ""
xt = ""
xu = ""
''------------------------
Set xs = Mydoc.FindElementByClass("def-head ddef_h")
Set xt = Mydoc.FindElementByCss(".def-head ddef_h")
''Set xs = Mydoc.FindElementByXPath("/html/body/div[2]/div/div[1]/div[2]/article/div[2]/div[2]/div[3]/div/div/div[3]/div[1]/div[2]/div/div[3]/div[1]")
''Set xt = Mydoc.FindElementByXPath("/html/body/div[2]/div/div[1]/div[2]/article/div[2]/div[2]/div[3]/div/div/div[3]/div[1]/div[2]/div/div[3]/span")
''Set xu = Mydoc.FindElementByXPath("/html/body/div[2]/div/div[1]/div[2]/article/div[2]/div[2]/div[3]/div/div/div[3]/div[2]/div[2]/div/div[3]/span")
xs = xs.Text
xt = xt.Text
xu = xu.Text
Range("B" & i).Value = xs
Range("C" & i).Value = xt
Range("D" & i).Value = xu
Next
End Sub