How do i get the data of the row that includes the checked checkbox? I have tried several ways to check if this checkbox is checked in VBA excel but it’s doesnt work. Below is the html of the table show the different of the rows.
Here the code that I’ve tried:
Set AllRows = TableToProcess.FindElementsByTag("tr")
For Each SingleRow In AllRows
Set SingleCell = SingleRow.FindElementByXPath("//td[@style='white-space:nowrap;']")
Set Check = SingleCell.FindElementByXPath("//input[@checked='checked']")
Debug.Print Check.Value
'Set CheckBox = SingleRow.FindElementByXPath("//input[@type='checkbox']")
If Check.Attribute(Checked) = "checked" Then
'FindElementByXPath("//input[@checked='checked']") Then
RowNum = RowNum + 1
Set AllRowCells = SingleRow.FindElementsByTag("td")
For Each SingleCell In AllRowCells
ColNum = ColNum + 1
'If SingleCell.FindElementBytype("checkbox").ischecked Then
Set TargetCell = OutputSheet.Cells(RowNum, ColNum)
TargetCell.Value = SingleCell.Text
'End If
Next SingleCell
End If
ColNum = 0
Next SingleRow
End Sub
New contributor
Ryan Nguyen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.