The integral does not diverge.
Choose $u = e^x$ so $\mathrm dx = \frac{\mathrm du}{e^x}$ so $\int_0^{\infty}(\frac{e^x}{e^{2x}+1})\mathrm dx$ becomes $\int_1^{\infty}( \frac{\mathrm du}{u^2 +1})$ but it diverges.
What is the fallacy here? I clearly made some mistake in changing the base but I cannot spot it.