The invention discloses a method for eliminating dazzle light and electronic equipment, and the method comprises the steps: photographing a first image, wherein a first region of the first image comprises the dazzle light; outputting first prompt information; when the electronic device meets a first shooting condition corresponding to the first prompt message, shooting at least one second image, wherein a second area corresponding to the first area in the at least one second image does not include dazzle light; and generating a target image according to the first image and the at least one second image. According to the method, a first area of the shot first image comprises dazzle light; when the electronic equipment meets a first shooting condition, at least one second image is shoot, wherein a second area, corresponding to the first area, in the at least one second image does not include dazzle light, a picture of the second area is used for replacing a picture of the first area to obtain a target image, the target image includes the second area and other areas except the first area in the first image, the dazzle light in the first area is eliminated, and the image quality is improved.