Is it possible to add multiple/all layers from a WMS service with PyQGIS?
It is possible to add a WMS layer with PyQGIS if layer name to be added is exactly known. (which is 'MA-ALUS' in the code below)
urlWithParams = 'url=http://kaart.maaamet.ee/wms/alus&format=image/png&layers=MA-ALUS&styles=&crs=EPSG:3301'
rlayer = QgsRasterLayer(urlWithParams, 'MA-ALUS', 'wms')
QgsMapLayerRegistry.instance().addMapLayer(rlayer)
Assuming that if want to add all of the layers in the WMS service, what should be the proper PyQGIS code/implementation?
e.g. code below gives a list of all layers in the WMS if it is executed under QGIS Python Console (so that one can choose and add multiple layers).
qgis.utils.iface.addRasterLayer("https://tucbs-public-api.csb.gov.tr/csb_cdp_abi_wms?&service=wms")
My question is; is it possible to implement similar operation with PyQGIS?