Replies: 2 comments 1 reply
-
Hi Joe, If you can answer a couple of questions first that'll give me a better idea of what's required for this.
Are you seeing an exception? What's going on exactly? Can you please provide a code example so I can see what you are doing. |
Beta Was this translation helpful? Give feedback.
0 replies
-
If I call GetSourceAsync on
private void Browser_LoadingStateChanged(object? sender,
LoadingStateChangedEventArgs e)
{
if (e.IsLoading)
return;
browser.GetSourceAsync().ContinueWith(taskHtml =>
{
if (taskHtml.Result != null)
HtmlSource = taskHtml.Result;
});
}
private void Browser_FrameLoadEnd(object? sender,
FrameLoadEndEventArgs e)
{
browser.GetSourceAsync().ContinueWith(taskHtml =>
{
if(taskHtml.Result != null)
HtmlSource = taskHtml.Result;
});
}
That works. But that is only initially.
If I use GetSourceAsync on buttonClick then many times the html code is
just partially read.
I have tried many different solutions, and I haven't documented every try.
But the latest is:
private async void btnTest_Click(object sender, RoutedEventArgs e)
{
browser.Dispatcher.BeginInvoke(async () =>
{
Task<string> t = browser.GetSourceAsync();
t.Wait(5000);
HtmlSource = t.Result;
});
}
I now wonder if the source code could have some strange characters so the
GetSourceAsync just stops in the middle. One example is that the last it
reads is "<a data-control-id="[¢ ‰àDCÔ â". The full attribute, retrieved by
ViewSource is "<a data-control-id="[¢ ‰àDCÔ â jäîŒ(".
It seem to be always in the middle of a "data-control-id" that it stops
reading.
If you think you can help, then name how much you want for the help. But we
only want to pay for a solution that works. Can I have direct contact so
not all have to be posted on a forum?
Best regards
Joe, Sweden
Den ons 20 apr. 2022 kl 04:51 skrev Alex Maitland ***@***.***
…:
Hi Joe,
If you can answer a couple of questions first that'll give me a better
idea of what's required for this.
I have tried to get source code with GetSourceAsync without success.
Are you seeing an exception? What's going on exactly?
Can you please provide a code example so I can see what you are doing.
—
Reply to this email directly, view it on GitHub
<#4068 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYQI3QHL32RAKMN6TBHRLIDVF5WKJANCNFSM5TYSJ4CQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Amaitland,
Do you have possibility to help us and how much do you want for helping us with the following:
I have tried to get source code with GetSourceAsync without success.
In short: I want to be able to click a button (or through method call) and the method being called should retrieve the source code (all source code, also dynamically genererated code).
Best regards
Joe, Sweden
Beta Was this translation helpful? Give feedback.
All reactions