Uti during pregnancy

Can you take anything for a uti while pregnant?