Wireless sensor networks (WSNs) are widely used in variety fields, especially in the Web of Things. The sensor localization information is important for the capability of it. The centroid algorithm is a kind of no ranging location algorithm, which is widely used in the positioning in WSN. To improve the positioning accuracy, this paper puts forward an improved weighted centroid algorithm, then self-corrected. We take any four beacon nodes to improve the node localization accuracy, retaining the simplicity of algorithm and saving nodes energy. These four beacon nodes compose a quadrangle, which is then divided into two triangles to seek centroids and get their average values. Thereafter, we measure each beacon node and empower the values, then use the centroid localization algorithm again to locate object nodes. The simulations show that the algorithm effectively improves the positioning accuracy of the unknown nodes.