  Let $\Omega$ be an arbitrary bounded domain of $\R^n$. We study the right
invertibility of the divergence on $\Omega$ in weighted Lebesgue and Sobolev
spaces on $\Omega$, and rely this invertibility to a geometric characterization
of $\Omega$ and to weighted Poincar\'e inequalities on $\Omega$. We recover, in
particular, well-known results on the right invertibility of the divergence in
Sobolev spaces when $\Omega$ is Lipschitz or, more generally, when $\Omega$ is
a John domain, and focus on the case of $s$-John domains.
