Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I manage to do this for webBrowser and now i will lke to do same things for gecko browser, but geting a error:
"'Gecko.GeckoDocument' does not contain a definition for 'Window' and no extension method 'Window' accepting a first argument of type 'Gecko.GeckoDocument' could be found (are you missing a using directive or an assembly reference?)"

HtmlElement sr = default(HtmlElement);
HtmlElementCollection Elems = default(HtmlElementCollection);
Elems = webBrowser1.Document.GetElementsByTagName("input");
   try
     {
sr = webBrowser1.Document.Window.Frames["s_MainFrame"].Document.GetElementById("e-mailoutline-row-($Inbox)1");
string tr = sr.InnerText;
      if (tr != "Inbox")
       {
        ZaDruguformu();
       }
       else
       {
timer1.Start();
       }
       }
catch (Exception ex)
       {
       }


What I have tried:

GeckoHtmlElement sr = default (GeckoHtmlElement);
GeckoElementCollection Elems = default(GeckoElementCollection);
try
 {
sr=geckoWebBrowser1.Document.Window.Frames["s_MainFrame"].Document.GetElementById("e-mailoutline-row-($Inbox)1");
string tr = sr.InnerText;
if (tr != "Inbox")
{
ZaDruguformu();
}
else
{
timer1.Start();
}
}
catch (Exception ex)
{
}
Posted

1 solution

Find the element Frame.
Get ContentWindow
Convert to Document

Ex (getting first frame):
var lstFrame = geckoWebBrowser1.Document.GetElementsByTagName("FRAME");
if (lstFrame.Lenght < 1)
    return;
var content= ((Gecko.DOM.GeckoFrameElement)lstFrame[0]).ContentWindow;
var document = content.Document as GeckoDocument;

//Now search element as you like
sr = document.GetElementById("e-mailoutline-row-($Inbox)1");

.....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900