Hi, before going into depth you need to understand that irctc web portal is heavily encrypted, so you won't be able to bypass atleast the logins.
But alternatively what you can do is, you can approach for the api from Indian Railways gov portal. Here i can help you obtaining the one for you, or will scrape alternative sources.
Regards