Welcome Guest Search | Active Topics | Sign In | Register

Eo.WebView Save Image. Options
Mr.Worm
Posted: Sunday, May 31, 2015 2:50:20 PM
Rank: Newbie
Groups: Member

Joined: 5/31/2015
Posts: 3
Hi,
I have looked threw EO.Webbroswer classes and have yet to find a way to save an Image. I'm hopeing to "captcher()" It but I only want the one image. Is there a way to do this threw it's id?
eo_support
Posted: Monday, June 1, 2015 10:21:02 AM
Rank: Administration
Groups: Administration

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

There is not built-in support for you to save an image. However you can get the image element's src attribute and then download that directly. You would get the image's src attribute this way:

Code: C#
string imge_url = webView1.EvalScript("document.getElementById('your_image_element_id').src;") as string;


Once you have that, you can use the standard .NET HttpClient class to download that Url to get the image.

Thanks!
Mr.Worm
Posted: Monday, June 1, 2015 11:41:00 AM
Rank: Newbie
Groups: Member

Joined: 5/31/2015
Posts: 3
Sadly That won't work here. The image is a captcha that is randomly generated. I have found a dirty solution by setting Capture() point and size. But sadly it is quick and dirty. One change in position and it won't work. But for now it suffices. Currently I'm now having an issue with 3 threads closing (within the webview or webcontrol ) one these threads close the application hangs?
eo_support
Posted: Monday, June 1, 2015 12:18:41 PM
Rank: Administration
Groups: Administration

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

As to thread closing issue, if you can isolate the problem into a test app and send us the test app, we will be happy to investigate further. See here for more information on send us the test app:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Mr.Worm
Posted: Monday, June 1, 2015 12:36:30 PM
Rank: Newbie
Groups: Member

Joined: 5/31/2015
Posts: 3
I'll try to isolate it for you. It appears to be a problem with navigating in a while loop. One last thing, I was able to get the image location with javascript, I am returning [var x, var y] note: *(x=int, y=int) as string but the string is always undefined. I tryed a simple function to return hello, but code: string test = webView1.EvalScript("retHello()") as string; returns empty?
eo_support
Posted: Wednesday, June 3, 2015 10:46:54 AM
Rank: Administration
Groups: Administration

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

Please check how your retHello method returns value. If that function returns a string, then EvalScript("retHello()") should return a string.

If you wish to return multiple values, you can return an array.

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.