Fix document path engine to rely on classes instead of IDs for better chance of working on different pages