I tried using PhantomJSDriver for scraping this URL: http://www.tsetmc.com/loader.aspx?ParTree=151311&i=67126881188552864
1) First, in this URL we must click on the upper blue link named: سابقه
2) Then I want scrap this XPath: //*[@id="trade"]/div[2]/table/tbody/tr[9]/td[7]
Here is my code but this code can't find required XPath:
var driverService = PhantomJSDriverService.CreateDefaultService();
var driver = new PhantomJSDriver(driverService);
driver.Url = "http://www.tsetmc.com/loader.aspxParTree=151311&i=67126881188552864";
driver.Navigate();
var source = driver.PageSource;
driver.FindElementByXPath("//*[@id=\"tabs\"]/div/ul/li[3]/a").Click();
Thread.Sleep(5000);
try
{
var pathElement = driver.FindElementByXPath("//[@id=\"trade\"]/div[2]/table/tbody/tr[9]/td[7]");
MessageBox.Show(pathElement.Text);
}
catch
{
driver.Dispose();
this.Close();
}
driver.Dispose();