In his "Basic Algebraic Geometry(Volume 1)", on page 151, Shafarevich says:
Suppose that the variety $ X $ is nonsingular. In this case, for any prime divisor $ C \subset X $ and any point $ x \in X $ there exists an open set $ U \ni x $ in which $ C $ is defined in $ U $ by a local equation $ \pi. $
I accept this.
If $ D = \sum_{i} k_{i}C_{i} $ is any divisor, and each of the $ C_{i} $ is defined in $ U $ by a local equation $ \pi_{i}, $ then we have $ D = \text{div}(f) $ in $ U, $ where $ f = \prod_{i} \pi_{i}^{k_{i}}. $
Why is $ D = \text{div}(f), $ with $ f $ as defined? I know that the Weil divisor $ D $ is locally principal, but I wish I could have an explanation for this section that doesn't assume prior knowledge of that.
Thus every point $ x $ has a neighbourhood in which $ D $ is principal. From among all such neighbourhoods, we can choose a finite cover $ X = \bigcup U_{i}, $ and $ D = \text{div}(f_{i}) $ on $ U_{i}. $
Why can we choose such a cover?