Nowadays, in the case that many automatic robots and web crawlers retrieve web resources maliciously or illegally, more and more websites add the captcha technology to identify whether website visitors are human beings. To test whether a captcha generation system is easy to recognise and help to improve such a system, the author has constructed a 4-character captcha recognition model based on the convolutional neural network via a Python programming experiment. In this experiment, the captcha library in Python helped to generate all captcha images and datasets. Firstly, the author generated 500,000 original single-character captcha images from the corresponding python library. Secondly, images were preprocessed to create the dataset of single-character images. Thirdly, the author built the CNN model and trained it with the dataset generated in step 2. Then, a new input captcha could be segmented into four characters and recognised in sequence by the well-trained model. Eventually, the evaluation result shows that single-character recognition accuracy is 97.3% and 4-character captcha recognition accuracy is 96.2%. The most common mistakes the model made are recognizing “0” as “D”, “5” as “S”, “Y” as “V”.