Hi
I want to get Time value of below value - 'ytp-time-duration'
const string XPATH_TIME = "//span[@class = 'ytp-time-duration']";
Thanks
Hi
I want to get Time value of below value - 'ytp-time-duration'
const string XPATH_TIME = "//span[@class = 'ytp-time-duration']";
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tahir AnsariRank #366 · 6.8K reputationPosted Apr 9, 2024, 1:23 AM EDT
string timeValue = ""; try { var timeElement = _driver.FindElement(By.XPath(XPATH_TIME)); timeValue = timeElement.GetAttribute("innerText"); } catch (NoSuchElementException) { // Handle if the element is not found } Console.WriteLine("Time value: " + timeValue);