I have many mxds that previously used ArcGIS Online Bing imagery. I want to replace those with newly purchased imagery. I know I need to use the arcpy.mapping.MapDocument module to do this though not sure how. However when I try to identify the source for the online imagery it is listed as 'source unknown'. Script snippet below shows how I am trying to identify sources in each mxd which I am writing to a .csv
for map in mxd_list:
mxd = arcpy.mapping.MapDocument(map)
layers = arcpy.mapping.ListLayers(mxd, '*')
for i in layers:
try:
ds = i.dataSource
except:
ds = 'source unknown'
writer.writerow([map, i.name, ds ])