Welcome Guest Search | Active Topics | Sign In | Register

i want save web request respone Options
czt
Posted: Tuesday, May 4, 2021 9:03:58 AM
Rank: Newbie
Groups: Member

Joined: 5/4/2021
Posts: 3
hi
my code for exam:

webViewy.LoadUrlAndWait("http://abcd.com")

For example, I load the above page with the above code and save it with the capture or gethtml command.
But the problem is that this page contains code that is loaded image from another url.
This means that when sending a request to load, the page itself sends several requests to load photos or scripts or css, and I want to save them as well.

my request:
webViewy.LoadUrlAndWait("http://abcd.com")

site requests after my request:
http://abcd.com/hgys.css
http://abcd.com/for.aspx

I looked at the source of this page and saw that it contains this code:
<img id="ctl00_PlaceHolder9_img" src="for.aspx" style="height:40px;width:110px;border-width:0px;" align="absmiddle">

i want save for.aspx
eo_support
Posted: Tuesday, May 4, 2021 1:13:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

There is no built-in support for that. However you can use JavaScript code in the page to determine whether all images have been loaded. You can find some sample JavaScript code on this page:

https://stackoverflow.com/questions/11071314/javascript-execute-after-all-images-have-loaded

You can run this code with WebView.EvalScript after LoadUrlAndWait returns.

The code on that page calls

Code: JavaScript
console.log( 'All images loaded!' );


Obviously you will need to change that line to notify your C# side code instead. You can use JavaScript extension to do this. See here for more details:

https://www.essentialobjects.com/doc/webbrowser/advanced/jsext.aspx

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.