Text messages, social media interaction, etc. can all constitute evidence of infidelity. You can get this legally but have to first file the divorce case before getting the evidence: once the case is filed, there are legal tools or mechanisms available in litigation, called "discovery," such as written questions or interrogatories, or document production requests, to your spouse, or subpoeanas to third parties, like service providers. The hitch is that, as stated, to access these tools, you have to file first, before having the evidence you seek.