A hierarchical graph is a kind of self-similar network, which is widely discussed and has a wide range of applications. In this paper, we introduce a class of weighted hierarchical graphs H (n, k), which is constructed using the hierarchical product of complete graphs. The weighted hierarchical graph depends on two parameters: the weighted factor r (0 < r <= 1) and the number k (k >= 3) of nodes of the complete graph K-k. In addition, we also discuss the trapping problem and the average trapping time (ATT) for a weight-dependent walk on a weighted hierarchical graph. Based on the special structure of the weighted graph, we derived the exact expression of the ATT for a weighted hierarchical graph. The results show that the ATT obeys a power-law function with the exponent ln(kr)/lnk < 1, which is related to the factors k and r and indicate that for kr = k(r = 1) and 1 < kr < k, the ATT has a linear and sublinear relationship with the network order, respectively. Therefore, the smaller kr is, the more efficient the trapping process of the weighted hierarchical graph is. Compared with the unweighted hierarchical graph, the weighted hierarchical graph has a higher efficiency in the trapping process.