A porous triazine and carbazole bifunctionalized task-specific polymer has been synthesized via a facile Friedel-Crafts reaction. The resultant porous framework exhibits excellent CO2 uptake (18.0 wt%, 273 K and 1 bar) and good adsorption selectivity for CO2 over N2.