|
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?
|
|
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!
|
|
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?
|
|
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.aspxThanks!
|
|
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?
|
|
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!
|
|