Im gooing to use Vis-NIR spectroscopy to measure hydrocarbons in soil. And if VOCs can dissolve parafilm, then is not good to use it for hydrocarbons. In any case plastic is going to absorb hydrocarbons.
You should refine the question: namely, are you going to measure the hydrocarbons-in-soil - qualitatively or quantitatively ? Also you can replace "parafilm" by another polymer. There are a lot of polymers which do not absorb hydrocarbons and are transparent in UV-VIS. By the way, why to use UV-VIS - and not chromatography..., or even FTIR method (?)
While sampling soils for volatile contaminants it might be advisable to rely on possible applicable standard guidelines; cf. e.g.: United States Enironmental Protection Agency (EPA), "Behavior and determination of volatile organic compounds in soil ― A literature review", Report: EPA/600/R-93/140, May 1993; Australian Standard: AS 4482.2 ― 1999, "Guide to the sampling and investigation of potentially contaminated soil ― Part 2: Volatile substances"; or other comparable publications.
Unless you want to test it, I would assume parafilm function for this use may be questioned. As suggested, if there is a standard method applying to this, apply it. If you used perhaps glass containers (assuming those to be acceptable) with glass covers and then wanted to seal it better with parafilm to reduce any volatile gas leaking, that may be OK. In the statement below taken from material description, you wonder what happens after 48 hours.
General description
PARAFILM stretches up to 200% and clings even around irregular shapes and surfaces. The sealing film is free of plasticizers and consists primarily of polyolefins and paraffin waxes. PARAFILM M is resistant up to 48 hours against many polar substances, eg saline solutions, inorganic acids and alkaline solutions.
Thanks everyone. William, and I think so. I used it before for covering glasses during shaking on orbital shaker. After cca 5 minutes it started dissolving. So I think it is not the best option. Thanks everyone again .