Modulated pressure waves propagating in the drilling fluids inside the drill string are a reliable real-time communication technology that transmit data from downhole to the surface during oil and gas drilling. In the analysis of pressure waves’ propagation characteristics, the modeling of transient friction in non-Newtonian fluids remains a great challenge. This paper establishes a numerical model for transient pipe flow of power-law non-Newtonian fluids by using the weighted residual collocation method. Then, the Newton–Raphson method is applied to solve the nonlinear equations. The numerical method is validated by using the theoretical solution of Newtonian fluids and is proven to converge reliably with larger time steps. Finally, the influencing factors of the wall shear stress are analyzed using this numerical method. For shear-thinning fluids, the friction loss of periodic flow decreases with the increase in flow rate, which is opposite to the variation law of friction with the flow rate for stable pipe flow. Keeping the amplitude of pressure pulsation unchanged, an increase in frequency leads to a decrease in velocity fluctuations; therefore, the friction loss decreases with the increase in frequency.