Let $X$ be a scheme. Assume $X$ is noetherian, integral, and locally factorial. Let $\eta$ be the generic point of $X$, then the function field of $X$ is $K(X):=O_{X, \eta}$. Let $Y$ be a prime divisor of $Y$, and $y$ its generic point.
I am trying to show that $K(X)$ is isomorphic to $Frac(O_{X,y})$. I would appreciate if someone could explain me how to construct the isomorphism. Thank you.
Below is my attempt at this when $X = \operatorname{Spec}R$. In this case the generic point is the zero ideal. Let $Y$ be a prime divisor, say it is $Y = V(P)$ where $P$ is a prime ideal of $R$, in other words this is the generic point of $Y$. Then $$ O_{X, P} = R_P $$ and since we know that this is an integral domain because $R$ is. Then it follows that $$ Frac(R_P) \cong Frac{R} = R_{(0)} $$ where the isomorphism is given by $$ \frac{r/x}{r'/y} \mapsto \frac{r y}{r'x}. $$
This establishes the case when $X$ is affine. What am I not seeing is how can we reduce to this case when it $X$ is not affine. Can we always find an affine open that contains $\eta$ and $y$?
The generic point $\eta$ is, more or less by definition, dense in $X$. So given any affine open neighborhood $U$ of $y$ in $X$, you also get $\eta \in U$ for free.
After that, since you have $\eta, y \in U$, the affine case applies.