Aiming at the given wall-climbing robot path planning algorithm difficult to plan effectively online, an adaptive path planning algorithm based on K-Means algorithm and classic Sarsa(λ) algorithm are designed. Firstly, the dynamical model for wall-climbing robot is designed. Then the states of the planning space is clustered adaptively to realize the value function approximating, the improved fuzzy K-Means with the variable K is designed to cluster on-line, using value of the cluster center as the approximate value for all the sample of the whole cluster. Finally, the algorithm based on fuzzy K-Means and classic Sarsa(λ) algorithm for wall-climbing robot path planning is defined and described. The simulation experiment with simple barrier and complicate barrier is operated in the MATLAB, the result shows the method in this paper can realize the path planning, and with the increase of the episode, the planning result is converged to the optimal value, and also the convergence effect is not subject to the change of the environment, so it has strong feasibility. It is a on-line planning method for wall-climbing robot path planning.