0


Hello All
Before write this post I read and tried this:
Null Value from GetElementById using C#
How to getelement by class?
C# get element by name
and more.
So
1. I have control on form webBrowser1
2. webBrowser1.Navigation("my url").
3. Check that webBrowser1.ReadyState == WebBrowserReadyState.Complete.
4. After this I tried find element that in i.e. looks like:

<div class="button" style="float: right;">
        <input name="uc_InvoiceLines$btnBook" tabindex="5030" class="btnBook btn" 
           id="uc_InvoiceLines_btnBook" onclick="javascript: return 
           ValidationOnBooking('You are about to book the invoice. Do you want to 
           continue','Invoice lines');" type="submit" value="Book"> 
</div>


5. foreach (HtmlElement ch in webBrowser1.Document.All)
i cannot see this element in .Inner/Outer HTML/TEXT
6. I guest this element has been created by js but don't understand why I can see it in i.e. explore and cannot find in webBrowser1.Document.All?

Anybody can help me to find this "Fantom"?

Yared
  • 2,206
  • 1
  • 21
  • 30
AlGraf
  • 15
  • 1
  • 6
  • Is this element nested in an iframe? – A. Wolff Dec 28 '17 at 12:38
  • yes it's part of iframe – AlGraf Dec 28 '17 at 12:41
  • 1
    So it is on different `document`. If cross domain iframe and this framed page doesn't handle post message API, you cannot access it. Otherwise read one of the many dupe: https://stackoverflow.com/questions/1088544/get-element-from-within-an-iframe or https://stackoverflow.com/questions/9393532/cross-domain-iframe-issue etc... – A. Wolff Dec 28 '17 at 12:44

1 Answers1

0

"So it is on different document. If cross domain iframe and this framed page doesn't handle post message API, you cannot access it. Otherwise read one of the many dupe: stackoverflow.com/questions/1088544/… or stackoverflow.com/questions/9393532/cross-domain-iframe-issu‌​e etc... – A. Wolff "
Thank you very much it's correct answer.

AlGraf
  • 15
  • 1
  • 6