2

i use geckofx c# to get the textcontext. why can't I get the textcontent result if the html element is like this

<div>
    <div class="text1">
        <div class="text2">Michael</div>
        <div class="text2">Andrey</div>
    </div>
</div>

output : null

whereas if the html element like this

<div class="text">
    <div class="text1">
        <div class="text2">Michael</div>
        <div class="text2">Andrey</div>
    </div">
</div>

output : Michael, Andrey

I use geckofx code like this

GeckoNodeCollection names = geckoWebBrowser1.Document.GetElementsByClassName("text1");
foreach (GeckoNode name in names)
{
    console.writeline(name.TextContent);
}

the difference that I see is in <div> and <div class="text">. I appreciate all the help you provide.

Kolimondi
  • 87
  • 1
  • 5
  • 1
    Hi - based on your sample, it *should* work in both cases. I suppose there is a problem somewhere else. I assume the code samples you provided are simplified a bit? – Bartosz Jan 15 '20 at 10:27

0 Answers0