Hi there,
I tried to use the following codes to find "1+2" ( the value of inputDataSheet.Cells(2, 2)) and then change the value (default value = 10) in the input box to the value in inputDataSheet.Cells(i, 3). The code stopped at the line in bold below and said the element was not found.
May I know what's wrong with the codes? Thanks.
Below are the codes of the webpage extracted from developer inspection:
Regards,
Kevin
I tried to use the following codes to find "1+2" ( the value of inputDataSheet.Cells(2, 2)) and then change the value (default value = 10) in the input box to the value in inputDataSheet.Cells(i, 3). The code stopped at the line in bold below and said the element was not found.
May I know what's wrong with the codes? Thanks.
Code:
Sub copyodd()
'
' copyodd Macro
'
Application.Run ("StopTimer")
DebuggerPort = MyChrome.Manage.Capabilities("goog:chromeOptions").Item("debuggerAddress")
MyChrome.SetCapability "debuggerAddress", "localhost:" & DebuggerPort
Dim i As Integer
Dim inputDataSheet As Worksheet
Dim fin1 As Object
Dim fin2 As Object
Set inputDataSheet = ThisWorkbook.Sheets("InputData")
For i = 2 To 276
If inputDataSheet.Cells(i, 4) = "Yes" Then
MyChrome.FindElementById(inputDataSheet.Cells(i, 1)).Click
Set fin1 = MyChrome.FindElementByXPath("//div[@class='collapse-betline'][normalize-space()='" & inputDataSheet.Cells(i, 2) & "']")
[B] Set fin2 = fin1.FindElementByXPath(".//following-sibling::div[@class='unitbet-input ']//input[@value= '10']")[/B]
fin2.ClickDouble
fin2.SendKeys inputDataSheet.Cells(i, 3)
DoEvents
End If
Next i
MyChrome.FindElementById("bsSendPreviewButton").Click
Sheets("Sheet3").Select
Range("A1").Select
End Sub
Below are the codes of the webpage extracted from developer inspection:
Code:
<div class="bet-type-col small-bet-type-col">
<div class="collapse-content-l">
<div class="collapse-betline">1 + 2 </div>
<div class="collapse-content-r">
<div class="unitbet-input ">
<span>$</span>
<input maxlength="10" type="text" inputmode="numeric" value="10" style="font-size: 15px;">
Regards,
Kevin