S
S
Stepan Sidorov2020-05-04 14:10:39
Parsing
Stepan Sidorov, 2020-05-04 14:10:39

Why can't C# selenium find element text even though it finds classes?

I need to parse some elements from the site: https://csgorun.org.
The elements are found, but when I output them, they are output as empty strings.
Here is the code snippet where it happens:

driver.Url = @"https://csgorun.org/";
Thread.Sleep(4000);
Console.WriteLine(driver.PageSource);
var find_bank = driver.FindElements(By.TagName("b"));
foreach (IWebElement ban in find_bank)
 {
        Console.WriteLine(ban.Text);
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Yakushenko, 2020-05-04
@Stepan47

ban.GetAttribute("innerHTML");try

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question