johnjam Posted October 2, 2009 Share Posted October 2, 2009 (edited) Hello to all, Ive been working on a script for about a week now off and on, searched the forums forever, basically its a loop that runs data in from csv file and injects them to a web search page and with a series of mouse clicks I can retrieve the image. The csv file is supplied by our supplier and has given permission for us to use the images from there web page, which i have done, it works quite nicely for most part of the program however, when I hit a discontinued item and no image is there for download the program obviously goes awry. I have been looking at ways in which to alleviate this lack of error trapping and say scan for the image and trying to code in as appropriate. I have tried PixelSearch and _IEImgGetCollection for the scanning of an image. pixel search doesnt bring back any results possibly because im using two screens so the co-ords might be out. I need to check this when i get home. And _IEImgGetCollection although picks up the images in the outer html i cant find the one im looking for. In the Auto It forum is there a for sure method in which this can be done. Many Thanks in Advance johnjam Edited October 2, 2009 by johnjam Regards JohnJam Link to comment Share on other sites More sharing options...
Zedna Posted October 2, 2009 Share Posted October 2, 2009 Look at Image search library http://www.autoitscript.com/forum/index.php?showtopic=65748&st=0&p=488195&#entry488195 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
johnjam Posted October 2, 2009 Author Share Posted October 2, 2009 Look at Image search libraryhttp://www.autoitscript.com/forum/index.php?showtopic=65748&st=0&p=488195&#entry488195Many Thanks ZednaI dont post very often but when I do the responses are always very fastwill give the link a try and see how i get onjohnjam Regards JohnJam Link to comment Share on other sites More sharing options...
johnjam Posted October 15, 2009 Author Share Posted October 15, 2009 Hello to all, First of all many thanks to Zedna for the previous help when looking for images, the image search library will come in handy in the future however, I didnt use image search libaray on this occasion. I used the IE body read function to tell me if there was a result for an image by using the text on screen to show if there was an error message. Hope Im making sense so far. To get to the point I have made a script obvioulsy with help from the forums that works quite well most of the time but after a period of time it stops doing a certain function in calling the function "Err" this does work when freshly booted and launched for quite some time but as i say tends to fall over after a period of time say 2 or 3 hours. I'm guessing that the text file in question is becoming corrupted or something like that, I have tried to delete the file in question but as its in a loop and the file is in use it makes it impossible to delete, so then i thought I would clear its contents via the fileopen mode 2 function which does work with the afore mentioned problem. I'm really trying to get my programmming a bit better and get to the bottom of why this is happening. I would really appreciate a pointer as to where im going wrong with this TestScript.au3 Regards JohnJam Link to comment Share on other sites More sharing options...
Zedna Posted October 15, 2009 Share Posted October 15, 2009 (edited) original if FileExists($Errx) then FileOpen("C:\test\test1.txt", 2); used to clear contents of body read FileClose("$Errx") EndIf corrected if FileExists($Errx) then $FileHandle = FileOpen($Errx, 2); used to clear contents of body read FileClose($FileHandle) EndIf Edited October 15, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted October 15, 2009 Share Posted October 15, 2009 Another tip: When you use IE UDF then try to use its functions for manipulating with IE page instead of Send/MouseClick/etc. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
johnjam Posted October 15, 2009 Author Share Posted October 15, 2009 Many Thanks Zedna, For the corrected code and the tips Will certainly give the IE UDF functions a better look at Regards JohnJam Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now