def by_y(match):
return match.y
icons = findAll("Capture.PNG")
# sort the icons by their y coordinates and put them into a new variable sorted_icons
sorted_icons = sorted(icons, key=by_y)
# another shorter version is using lambda.
print sorted_icons[3]
# Iterate the images and hover it - To confirm
for icon in list(sorted_icons)[:2]:
hover(icon)
#Click the 4th image from the list.
No comments:
Post a Comment