c# Get innerHtml of an iFrame (using native .net framework)
up vote
0
down vote
favorite
using SHDocVw;
If I set up an internet explorer object and navigate to a page, I can get the innerhtml of the document like so:
mshtml.HTMLDocument htmlDoc = IE.Document;
string s = htmlDoc.body.innerHTML;
But this HTML is always missing the contents of the various iframes contained within it (even though I can see these in the DOM explorer in F12 dev).
How can I get iframe content?
I've tried:
1) This java attempt here but not sure how to replicate that in c#
2) getting the parent window properties e.g. htmlDoc.parentWindow.frames
but not sure how to isolate frames
3) Banging my head against the keyboard
4) Also not able to use HTMLAgilityPacks or external libraries since this needs distributed widely and we're not sure of the implications of using these "external" libraries
Most answers seem related to js but there's usually a tonne of answers related to IE traversing on c#
c# html iframe
add a comment |
up vote
0
down vote
favorite
using SHDocVw;
If I set up an internet explorer object and navigate to a page, I can get the innerhtml of the document like so:
mshtml.HTMLDocument htmlDoc = IE.Document;
string s = htmlDoc.body.innerHTML;
But this HTML is always missing the contents of the various iframes contained within it (even though I can see these in the DOM explorer in F12 dev).
How can I get iframe content?
I've tried:
1) This java attempt here but not sure how to replicate that in c#
2) getting the parent window properties e.g. htmlDoc.parentWindow.frames
but not sure how to isolate frames
3) Banging my head against the keyboard
4) Also not able to use HTMLAgilityPacks or external libraries since this needs distributed widely and we're not sure of the implications of using these "external" libraries
Most answers seem related to js but there's usually a tonne of answers related to IE traversing on c#
c# html iframe
Are those iframes maybe populated with an xhr call (json)? Do you have the url?
– Ole EH Dufour
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
using SHDocVw;
If I set up an internet explorer object and navigate to a page, I can get the innerhtml of the document like so:
mshtml.HTMLDocument htmlDoc = IE.Document;
string s = htmlDoc.body.innerHTML;
But this HTML is always missing the contents of the various iframes contained within it (even though I can see these in the DOM explorer in F12 dev).
How can I get iframe content?
I've tried:
1) This java attempt here but not sure how to replicate that in c#
2) getting the parent window properties e.g. htmlDoc.parentWindow.frames
but not sure how to isolate frames
3) Banging my head against the keyboard
4) Also not able to use HTMLAgilityPacks or external libraries since this needs distributed widely and we're not sure of the implications of using these "external" libraries
Most answers seem related to js but there's usually a tonne of answers related to IE traversing on c#
c# html iframe
using SHDocVw;
If I set up an internet explorer object and navigate to a page, I can get the innerhtml of the document like so:
mshtml.HTMLDocument htmlDoc = IE.Document;
string s = htmlDoc.body.innerHTML;
But this HTML is always missing the contents of the various iframes contained within it (even though I can see these in the DOM explorer in F12 dev).
How can I get iframe content?
I've tried:
1) This java attempt here but not sure how to replicate that in c#
2) getting the parent window properties e.g. htmlDoc.parentWindow.frames
but not sure how to isolate frames
3) Banging my head against the keyboard
4) Also not able to use HTMLAgilityPacks or external libraries since this needs distributed widely and we're not sure of the implications of using these "external" libraries
Most answers seem related to js but there's usually a tonne of answers related to IE traversing on c#
c# html iframe
c# html iframe
edited Nov 19 at 13:45
asked Nov 19 at 13:23
jamheadart
1,3282725
1,3282725
Are those iframes maybe populated with an xhr call (json)? Do you have the url?
– Ole EH Dufour
yesterday
add a comment |
Are those iframes maybe populated with an xhr call (json)? Do you have the url?
– Ole EH Dufour
yesterday
Are those iframes maybe populated with an xhr call (json)? Do you have the url?
– Ole EH Dufour
yesterday
Are those iframes maybe populated with an xhr call (json)? Do you have the url?
– Ole EH Dufour
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53375592%2fc-sharp-get-innerhtml-of-an-iframe-using-native-net-framework%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are those iframes maybe populated with an xhr call (json)? Do you have the url?
– Ole EH Dufour
yesterday