webBrowser.document找不到元素

问题描述 投票:0回答:1

大家好 在写这篇文章之前我读过并试过这个: Null Value from GetElementById using C# How to getelement by class? C# get element by name 和更多。 所以 1.我对表单webBrowser1有控制权 2. webBrowser1.Navigation(“我的网址”)。 3.检查webBrowser1.ReadyState == WebBrowserReadyState.Complete。 在此之后,我尝试找到元素,即看起来像:

<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(webBrowser1.Document.All中的HtmlElement ch) 我无法在.Inner / Outer HTML / TEXT中看到这个元素 6.我客人这个元素是由js创建的,但是不明白为什么我可以看到它,即探索,在webBrowser1.Document.All找不到? 有人可以帮我找到这个“Fantom”吗?

javascript c# dom webbrowser-control document
1个回答
0
投票

“所以它在不同的文档上。如果跨域iframe和这个框架页面不处理post message API,你就无法访问它。否则请阅读其中一个dupe:stackoverflow.com/questions/1088544 / ...或stackoverflow.com / questions / 9393532 / cross-domain-iframe-issu e等... - A. Wolff“ 非常感谢你的回答。

© www.soinside.com 2019 - 2024. All rights reserved.