Wafers of silicon and compound semiconductors are nanostructured by using electrochemical or chemical etching (stain etching) in etching cell with electrolyte kept by capillary forces. Atomic force microscopy, infrared spectroscopy and Raman scattering methods reveale nanoporous and nanocrystalline structure of the treated surfaces. The formed porous semiconductors demonstrate efficient photoluminescence, which is controlled by etching parameters, i.e. current density, electrolyte content, etc. These results indicate good prospects of the employed capillary-cell method for preparing nanostructured porous materials with desired structure and optical properties.