  In this paper, we propose a general framework for the trapping problem on a
weighted network with a perfect trap fixed at an arbitrary node. By utilizing
the spectral graph theory, we provide an exact formula for mean first-passage
time (MFPT) from one node to another, based on which we deduce an explicit
expression for average trapping time (ATT) in terms of the eigenvalues and
eigenvectors of the Laplacian matrix associated with the weighted graph, where
ATT is the average of MFPTs to the trap over all source nodes. We then further
derive a sharp lower bound for the ATT in terms of only the local information
of the trap node, which can be obtained in some graphs. Moreover, we deduce the
ATT when the trap is distributed uniformly in the whole network. Our results
show that network weights play a significant role in the trapping process. To
apply our framework, we use the obtained formulas to study random walks on two
specific networks: trapping in weighted uncorrelated networks with a deep trap,
the weights of which are characterized by a parameter, and L\'evy random walks
in a connected binary network with a trap distributed uniformly, which can be
looked on as random walks on a weighted network. For weighted uncorrelated
networks we show that the ATT to any target node depends on the weight
parameter, that is, the ATT to any node can change drastically by modifying the
parameter, a phenomenon that is in contrast to that for trapping in binary
networks. For L\'evy random walks in any connected network, by using their
equivalence to random walks on a weighted complete network, we obtain the
optimal exponent characterizing L\'evy random walks, which have the minimal
average of ATTs taken over all target nodes.
