The perfectly matched layer method (PML method) is a truncation technique well known for the numerical treatment of wave scattering problems in unbounded domains. In this paper, we study the convergence of the PML method for the wave scattering from an open waveguide in \(\mathbb {R}^2_+=\{x\in \mathbb {R}^2:x_2>0\}\) , where the refractive index is assumed to be a local perturbation of a function which is periodic with respect to \(x_1\) and equal to one above a finite height. The problem is challenging from the theoretical, and also from the numerical, point of view due to the existence of guided waves. A typical way to deal with this difficulty is to apply the limiting absorption principle. Based on the Floquet-Bloch transform and a curve deformation theory, the solution, derived from the limiting absorption principle, is rewritten as the line integral (with respect to the Floquet-Bloch parameter) of the solution of a system of quasi-periodic problems. By comparing the Dirichlet-to-Neumann maps on a straight line above the locally perturbed periodic layer, we finally show that the PML method converges exponentially with respect to the PML parameter. Finally, some numerical examples are shown to illustrate the theoretical results.