Is there any way to download and install ei capitan offline?
Yes.


Download the installer you want and then disconnect from all networks.
Use that installer to make a USB drive that boots and installs the OS.