Web Scraping using Selenium

I need some help. I am writing a web-scraping program on python using selenium where I can enter a number of tracking numbers at one and can extract the info into a dataframe. I have actually achieved it for other websites, but I cannot seem to figure out how to access the table that pops up on DTDC after entering the tracking numbers. I need some help.

This is the HTML code

1 Like

Hi,

Welcome to our community. Which Katalon product have you been using?

The <id> attribute is supposed to be unique, but in the above HTML, every row has the same one. Perhaps you can use that to get a list of items that you can do something with.

Maybe use variables “row” and “column” to increment over the cells:

  id("main")//table/tbody/tr[${row}]/td[${column}] 

or just get a list of web elements that have the same <id>

List<WebElement> list = driver.findElements(By.xpath('id("cnNNo")/preceding-sibling::tr/td'))

Note: this will only get those rows in the <tbody> area as the head would have <th> instead of <td>