Underwater wireless optical communication (UWOC) is a useful way to transmit a large volume of data in the ocean. In application, because light travels in a straight line, the two devices in the UWOC system should point to each other to establish an optical transmission link first. To make this process easier, it is helpful to carry at least one of these kinds of devices on an underwater robot. Then, such mobile terminal could actively adjust its orientation and position according to the cooperation one it located. Obviously, the locating method is quite crucial, which could be solved with visual navigation, if the communication distance is short and the water is quite clear. In this method, a camera is installed on the mobile terminal, while several light emitting diodes (LEDs) are in the cooperation one as guiding lights. In the image of a camera, by capturing the pattern formed of guiding light spots, the relative position and orientation between terminals could be calculated. However, in a UWOC system, visual navigation is interfered by the UWOC transmitter, because it could form an additional light spot in the camera's image. In this work, a UWOC-compatible visual locating method is presented, in which the installation positions of guiding lights form a convex polygon and a UWOC transmitter is inside of it. Then, guiding lights and the UWOC transmitter could be distinguished by their spatial distribution characteristics in the images. Based on such principle, the scheme of visual navigation in a UWOC system is shown, whose performance is experimentally demonstrated in a pool. The results show that light spots in the images that are formed by guiding lights could be recognized effectively, when a UWOC transmitter exists. While the distance between terminals is within 370 cm, the estimation error is no more than 1.70 cm. When the yaw angle is within 10 degrees, the estimation error is no more than 1.84 degrees. It is accurate enough for most UWOC applications. The method presented in this paper is simple, pragmatic, and useful, which could be a candidate to establish UWOC links in a short distance. (c) 2025 Optica Publishing Group. All rights, including for text and data mining (TDM), Artificial Intelligence (AI) training, and similar technologies, are reserved.