One generalization of degree is first Chern class: A Cartier divisor corresponds to a class in H1(OxX)$H^1(X;\mathcal{O}_X^{\times})$, and you take its image under the boundary map of the long exact sequence corresponding to the exponential exact sequence Z -> OX -> OxX$\mathbb{Z} \to \mathcal{O}_X \to \mathcal{O}_X^{\times}$ where the second map is taking exponential (if you want to work in the algebraic category, there is a fix for this, using the exact sequence Z/nZ -> OXx -> OXx$\mathbb{Z}/n\mathbb{Z} \to \mathcal{O}_X^{\times} \to \mathcal{O}_X^{\times}$, where the second map is nth power).
Geometrically, on a smooth thing, this means you take the sum of all the Weil divisors as a homology class, and then take the Poincare dual class in H2(X)$H^2(X;\mathbb{Z})$.