Recently, the characteristics of complex networks and community structure have attracted attention from academia and society, and their research and applications have become increasingly important. Community structure division makes complex networks easy to understand. However, most community structure division methods often need the number of communities and have low efficiency. In this paper, an efficient method of community structure division in complex networks based on the immune algorithm is proposed. The method aims to find the core members of communities and classify other members according to core members. The individual evaluation of the core member is obtained by the affinity degree of the immune algorithm. In addition, the clone and mutation operation in the traditional immune algorithm is improved to be affected not only by the affinity but also by the iterative process. The improved immune algorithm can guarantee antibody diversity in the early stage of search and convergence in the later stage, and it then achieves faster convergence and higher precision of community structure division. Compared with traditional methods, the proposed method does not need the number of communities in advance, can get better results on real datasets, and has greater efficiency.