The problem is I have a lot of data to download from a WFS. I've tried this method with different errors on the way. First I tried PyQGIS with this script:

```
uri = "http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/wfs/Edifici.map"
layer = QgsVectorLayer( uri, "my wfs layer", "WFS" )
crs=QgsCoordinateReferenceSystem(4326)
res = QgsVectorFileWriter.writeAsVectorFormat( layer,
                                                r'G..path...\edifita.shp',
                                               'System', # encoding
                                               crs, #crs
                                              'ESRI Shapefile'
       )

if res != QgsVectorFileWriter.NoError:
    print ('Error number:', res)
else:
    print ("WFS saved!")

```

I extracted from here: [Saving a WFS layer directly to the disk using QGIS or PyQGIS?](https://gis.stackexchange.com/questions/224274/saving-a-wfs-layer-directly-to-the-disk-using-qgis-or-pyqgis)

This method gives me the following error:

```
exec(open('C:/Users/JORDI~1.PAG/AppData/Local/Temp/tmpac2ti1a7.py'.encode('utf-8')).read())
Error number: (8, '')

```

Also, I tried this other method from the same source:

```
ogr2ogr -f "ESRI Shapefile" "...path..." WFS:"http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/wfs/Edifici.map" 

```

However, it gives me these 2 errors:

```
ERROR 1: HTTP error code : 504                                                                                                                     ERROR 1: Error returned by server : HTTP error code : 504 (0) 

```

I am not sure if the errors are caused by the large amount of data or something else.

What do you think?