A 13-year-old boy who had researched school shootings online was arrested hours after he tried to enter a Wisconsin elementary school with suspicious bags, police said.