The application relates to taking a sample of liquid contained in a flexible closed container, for example, a bag for collecting urine or blood. The problem to be resolved relates to piercing the wall of the container with a non- cutting piece, whilst obtaining a precise and clean opening for accessing the liquid and preventing any unintended flow or spill of liquid. The problem is solved according to the present invention by a device for taking a sample of liquid contained in a flexible bag (13, 14), which is characterised in that the device comprises a first section (20) having a base surface (21) and a film perforating element (22) protruding from the base surface (21). The device according to the invention further comprises a second section (23) having a base surface (24) surrounding a cavity (25), which is adapted for receiving the film perforating element (22) of the first section (20). The first section (20) has an adhesive surface surrounding the film perforating element (22), and the second section (23) has an adhesive surface surrounding the cavity (25). Furthermore, one of the two sections (20, 23) comprises an opening (26) in the base surface, inside of the adhesive surface (21).