Closed zydjohnHotmail closed 2 years ago
Essentially this would mean that you want to loop over the rows (tr
) and then over the columns td
. This guide should help you with that: https://playwright.dev/dotnet/docs/locators
We discourage using QuerySelector/All, see here: https://playwright.dev/dotnet/docs/locators#locator-vs-elementhandle
OK. Thanks!
Your question
Hello: I can use QuerySelectorAllAsync to get a collection of elements for a web page without iframe. However, now I have to parse a HTML table inside a iframe, there are a lot of table rows, which has the 'tr' elements. If I use var iframe = page.FrameLocator("#frameID"); then, how I can get all the table rows, those element has with 'tr' attribute? I can't find any example on this topic. For the web page without iframe, I can use the following statement: var trs = await page.QuerySelectorAllAsync("tr.class"); But in iframe, how I can return a collection of elements? Please advise, Thanks,