How to collect liquids you can't safely stand in?

Empty and throw the bottle into whatever it is you're trying to get. This very problem confused me for a while too till I realized you can throw and empty the flasks.