Electrically conductive porous metal-organic frameworks (MOFs) exhibit a huge potential in a broad range of applications. However, how to endow MOFs with appropriate electrical conductivity remains a challenge. In this paper, we report a controllable growth of polypyrrole (PPy) nanofibers in the nanochannels of MOFs to construct a kind of nanocomposites. We can also use this strategy to directly demonstrate the straight nanochannel structure in MOFs. More importantly, the formed PPy/ZIFs nanocomposites show a highly tunable electrical conductivity as well as a tunable electromagnetic absorption (EMA) property. The maximal frequency width with absorbing higher than 90% of incident electromagnetic waves reaches 7.24 GHz, which is wider than those of most reported MOFs or conducting polymers based EMA materials. An electrical conductance loss and interfacial polarization relaxation are used to investigate the electromagnetic dissipation mechanism of theses PPy/ZIFs nanocomposites. It opens up the rational design of electrically conductive MOFs for excellent electromagnetic absorption.