A wavelength selective switch includes an attenuation liquid crystal cell array and a switching liquid crystal cell array, the attenuation liquid crystal cell array is configured to select a region where a light is incident on the switching liquid crystal cell array; the switching liquid crystal cell array includes a first ECB liquid crystal cell array, which is divided into a plurality of pixel units, a phase of each pixel unit is adjusted by setting different voltages so that a phase pattern formed by the pixel units exhibits a lens property, and the light passing through the switching liquid crystal cell array is deflected by changing a center of the lens formed by the phase pattern, so as to select an outgoing port.