The name mercury originates from the god Mercurius to whom the Neo-Platonists and alchemists devoted the element after it was discovered.
But that is not the case for naming of Uranium. It was discovered in 1789 by Martin Klaproth, a German chemist while analyzing a black mineral, named pitchblende, obtained from a silver mine in Saxony, Germany. Klaproth examined the mineral and found that it consists chiefly of sulphur, combined with a peculiar metal to which he gave the name Uranium. This name was given after Uranus, the new planet discovered a few years earlier by another German-born scientist, William Hershel.