Text this: Mechanism of photoanodes for dye-sensitized and perovskite solar cells