I am trying to get the list of all available networks using WlanGetAvailableNetworkList. The scan returns an object which contains NumberOfItems. When I loop over the array of networks based NumberOfItems it only shows me the first network and anything beyond that gives me IndexError: invalid index.
here's my code
from win32wifi.Win32Wifi import WlanScan, WlanOpenHandle, WlanGetProfileList, WlanEnumInterfaces, WlanGetAvailableNetworkList, WlanCloseHandle, WlanConnect
handle =WlanOpenHandle()
interfaces = WlanEnumInterfaces(handle).contents
g= interfaces.InterfaceInfo[0].InterfaceGuid
WlanScan(handle, g)
networks= WlanGetAvailableNetworkList(handle, g).contents
print("Number of networks : ", networks.NumberOfItems)
for i in range(networks.NumberOfItems):
print('Network : ', networks.Network[i].dot11Ssid.SSID )
WlanCloseHandle(handle)
this questions is related to this question