This study proposes a method that is used for the nondestructive detection of copper content in corn leaves, which is achieved via visible–near infrared spectroscopy. In this paper, we collected the visible–near infrared spectral data of corn leaves that were planted in soils undergoing different gradients of heavy metal copper stress. Then, a preliminary pretreatment was carried out to obtain the original spectrum (OS), the continuous removal spectrum (CR), and the derivative of ratio spectroscopy (DRS). Singular value decomposition was used for spectral denoising. The characteristic bands corresponding to the OS, CR, and DRS were determined using correlation analysis, as well as mutual information. Based on training the extreme gradient boosting tree (XGBoost) predictive model using feature bands, the copper content in corn leaves was predicted, and a comparative analysis was conducted with the commonly used partial least squares regression (PLSR) model in regression analysis. The results showed that the accuracy of the PLSR and XGBoost models, which were established with CR and DRS, were higher than that of the OS, among which the DRS model had the highest accuracy. For the validation set in the PLSR model, the coefficient of determination (R2) was 0.72, the root mean square error (RMSE) was 1.21 mg/kg, and the residual predictive deviation (RPD) was 1.89. For the validation set in the XGBoost model, the R2 was 0.86, the RMSE was 0.86 mg/kg, and the RPD was 2.66. At the same time, the spectral data of the field-planted corn near a mining area were selected to test the robustness of the model. Among them, the DRS had a higher accuracy in the XGBoost model, where its R2 was 0.51, its RMSE was 0.86 mg/kg, and its RPD was 1.45, thus indicating that the model can better predict the copper content in corn leaves and that the model has a higher robustness, which could provide new ideas for the prediction of heavy metal content in crops.