Jump to content

Image recognition


Recommended Posts

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 by johnjam

Regards JohnJam

Link to comment
Share on other sites

Look at Image search library

http://www.autoitscript.com/forum/index.php?showtopic=65748&st=0&p=488195&#entry488195

Many Thanks Zedna

I dont post very often but when I do the responses are always very fast

will give the link a try and see how i get on

johnjam

Regards JohnJam

Link to comment
Share on other sites

  • 2 weeks later...

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

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 by Zedna
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...