Home > Software design >  How can i get text price data found in a class with C# using Selenium?
How can i get text price data found in a class with C# using Selenium?

Time:10-11

Im a new coder at web and im trying to do a price comparing website. Im trying to get price data from another website to mine. I've got some problems getting text price data. How can i get text under class and write in textbox? Here is my current code:

protected void Button1_Click1(object sender, EventArgs e)
        {
            IWebDriver driver = new ChromeDriver();
            string str ="";
            driver.Url = "https://www.akakce.com/arama/?q="   TextBox2.Text;
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
            str = driver.FindElement(By.XPath("//span[@class='pt_v8']")).GetAttribute("class");
            TextBox1.Text = ("price = "   str);
        }

And this is source code at website:

enter image description here

  • Related