You can't, of course. But even if you could, many networks allow for ARP spoofing so connecting to the right access point is not really the solution. And if ARP spoofing is not possible then you run airmon-ng and wireshark.
You would have it stored from a prior connection to the network. Of course, it's trivial to spoof that too so the additional check doesn't do any good.