Find elements by how they look.
Pyxelator is a Python library that locates UI elements from a cropped screenshot. Use it with your existing Selenium, Playwright, or Appium driver.
save_button.pngFrom screenshot to action
- Capture a template.
Crop a screenshot to one distinctive button or field. Keep its size and appearance consistent with the application you test.
- Find it on screen.
Pass your driver and the template path to Pyxelator. Matching compares the image with the current screenshot.
- Inspect the result, then continue.
The structured API reports whether an action succeeded. If a match is unsafe or ambiguous, it performs no click or write.
A first look at the API
With a driver already open on your application and a template saved locally:
from pyxelator import click_result
result = click_result(driver, "save_button.png", confidence=0.8)
if result.ok:
print("Save button clicked")
else:
print(result.reason)The quick start includes installation, a local demo page, and the full script.
When image matching helps
Use Pyxelator when an element is visible but difficult to target with a DOM selector, such as a canvas control or a mobile interface. Matching depends on appearance: changes in zoom, theme, or element size can require a new template.
Continue reading
- Create reliable templates
- Learn what to crop and how scaling affects a match.
- Tune match confidence
- Measure a match score before choosing a threshold.
- Look up the API
- Find parameters, return values, and compatible legacy functions.
