Although there is extensive research demonstrating the significant loss and fragmentation of urban spaces caused by rapid urbanization, to date, no empirical research in Shanghai has investigated the spatiotemporal dynamics of urban open spaces using a comprehensive set of integrated geospatial techniques based on long-sequence time series. Based on the Google Earth Engine (GEE) platform and using the Random Forest (RF) classifier, multiple techniques, namely landscape metrics, trend analysis, open space ratio, transition matrix, Normalized Difference Vegetation Index (NDVI), and fractal dimension analysis, were applied to analyze the Landsat satellite data. Next, Geographic Detector (GeoDetector) methods were used to investigate the driving forces of such spatial variations. The results showed that (1) the RF classification algorithm, supported by the GEE, can accurately and quickly obtain a research object dataset, and that calculating the optimal spatial grain size for open space pattern was 70 m; (2) open spaces exhibited declining and contracting trends; and open spaces in the city experienced a decline from 91.83% in 1980 to 69.63% in 2020. Meanwhile, the degree of open spaces in each district increased to different extents, whilst connectivity markedly decreased. Furthermore, the open space of city center districts showed the lowest rate of decrease, with open space patterns fragmenting due to encroaching urbanization; (3) the contribution of socioeconomic factors to the spatial–temporal changes in open space continually has increased over the past 40 years, and were also higher than natural geographic factors to some extent. Apart from offering policy insights guiding the future spatial planning and development of the city, this paper has contributions from both methodological and empirical perspectives. Based on integrated remote sensing and geographic information science (GIS) techniques, this paper provides updated evidence and a clearer understanding of the spatiotemporal variations in urban spaces and their influencing mechanisms in Shanghai.