← Back to team overview

sikuli-driver team mailing list archive

[Question #185866]: Handing errors for wait function while looping CSV file

 

New question #185866 on Sikuli:
https://answers.launchpad.net/sikuli/+question/185866

I was trying to loop through url's in a csv file, and taking a snapshot of each webpage with Evernote.

I'm a TOTAL beginner at both Sikuli and Python, and my code is getting errors when if fails to find an image after I've said to wait for it to appear.  It's kind of intermittent, but is there a way to try the wait command and if there is an error try again to click an image and wait?  I tried a ty: ... else:  block, but I didn't have the syntax working properly.

Here is a picture of the code:

http://dl.dropbox.com/u/12839821/Public%20Pictures/For%20use%20in%20webpages/59.png

App.open("C:\\Documents and Settings\\rgama\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe")
wait("kGuuglcwwwg0.png")
click("WWWQOOQIEC8.png")
myFile = file("C:\\Documents and Settings\\rgama\\Desktop\\Websites.csv")
content = myFile.readlines()
for line in content:
    (wrd, nmbr) = eval(''.join(('[', line.strip(), ']')))
    print "Website: ", wrd, "Number: ", nmbr
    paste(wrd)
    type(Key.ENTER)
    wait(4)
    click("1327350172734.png")
    wait("llClipfullpa.png")
    click("llClipfullpa.png")
    wait(4)
    type("l",KeyModifier.CTRL)

Thanks,

Rob.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.