I am using selenium as a web scraper and would like to locate a number of tables and then for every table (by looping) locate an element inside that table (without going through the entire document again).
I am using the Iwebelement.FindElements(By.XPath)
but keeps giving an error saying 'element no longer connected to DOM
'
here is an excerpt from my code:
IList[IWebElement] elementsB = driver.FindElements(By.XPath("//*[@id=\"col_main\"]/table[@class='risultati']"));
// which loads all tables with class 'risultati'
foreach (IWebElement iwe in elementsB)
{
IList[IWebElement] ppp = iwe.FindElements(By.XPath("//table"));
}
here I am trying to load inner tables from inside each table found in elements, but keeps giving me the error mentioned above.