Extracting oil and gas from water