This paper proposes a data‐driven bipartite leader‐following consensus strategy for a class of nonlinear multi‐agent systems (MASs) under external disturbances and hybrid attacks, which are composed of denial‐of‐service attacks and false data injection attacks. This data‐driven algorithm incorporates no system dynamics and only utilizes the input and output data generated by the controlled plant. First, the nonlinear MAS with external disturbances can be transformed into an equivalent linear data model by applying a revised dynamic linearization method. Second, a hybrid‐attack compensation mechanism is proposed to alleviate the adverse impact of data dropout caused by hybrid attacks. Then, based on the compensation mechanism, an extended state observer is designed that can mitigate the negative influence induced by external disturbances and improve the control performance even though the MAS is threatened by hybrid attacks. The systems under hybrid attacks and external disturbances can still remain stable with the proposed data‐driven strategy. Finally, simulation examples demonstrate the validity of the data‐driven strategy, and the bipartite consensus error can be reduced to a small range.