I am trying to get list of Layers from a Service using this code
from arcgis.gis import GIS
from arcgis.gis.server import Server
from arcgis.features import FeatureLayerCollection
gis_servers = gis.admin.servers.list()
server1 = gis_servers[0]
fservices = server1.services.list(folder='GDPServices')
for service in fservices:
layer = FeatureLayerCollection(service.url)
print(layer)
but I am receiving this error message
AttributeError: 'PropertyMap' instance has no attribute 'layers'
Can you please let me know why this is happening and how I can fix this?