driver.Navigate().GoToUrl("http://www.indiangoldrates.com/");
IWebElement table = driver.FindElement(By.XPath("//div[@id='post-7']//table[1]"));
ReadOnlyCollection<IWebElement> allRows = table.FindElements(By.TagName("tr"));
foreach (IWebElement row in allRows)
{
ReadOnlyCollection<IWebElement> cells = row.FindElements(By.TagName("td"));
foreach (IWebElement cell in cells)
{
Console.WriteLine("\t" + cell.Text);
}
}
IWebElement table = driver.FindElement(By.XPath("//div[@id='post-7']//table[1]"));
ReadOnlyCollection<IWebElement> allRows = table.FindElements(By.TagName("tr"));
foreach (IWebElement row in allRows)
{
ReadOnlyCollection<IWebElement> cells = row.FindElements(By.TagName("td"));
foreach (IWebElement cell in cells)
{
Console.WriteLine("\t" + cell.Text);
}
}
No comments:
Post a Comment