Roro Roro - 1 year ago 113
C# Question

C# Selenium XPath grabbing data from a table in a div

I am try to grab data from a table that has two columns. The rows do not have a distinct identifier. But I can search the first column for specifics to find out if I should grab the second column's data. The table does not have an id, but the Div does. I need to grab the dollar amounts seen in the screen shot below. I would be very grateful for your help.

enter image description here

Answer Source

Use following-sibling in xpath

//div[@id='subtotals-marketplace-table']//td[contains(text(),"Estimated tax")]/following-sibling::td[1]  
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download