A direct approach to finding exact invariants for one‐dimensional time‐dependent classical Hamiltonians