How does one get from this $$\zeta(s)=\sum_{k=1}^{\infty}\frac1{k^s}$$ to the integral representation $$\zeta(s)=\frac1{\Gamma(s)}\int_{0}^\infty \frac{x^{s-1}}{e^x-1}dx$$ of the Riemann Zeta function?
I can see that it can be rewritten as
$$\Gamma(s)\zeta(s)=\int_{0}^\infty \frac{x^{s-1}}{e^x-1}dx$$ and the Gamma function as an integral yields
$$\zeta(s)\int_{0}^\infty \frac{x^{s-1}}{e^x}dx=\int_{0}^\infty \frac{x^{s-1}}{e^x-1}dx$$
But this approach does not work as the right integral does not converge. So how does one go from the summation to the integral representation?