The article describes a new synthetic approach to modify the structure of phenol-formaldehyde and resorcinol-formaldehyde resins, which enables one to functionalize a polymer matrix by using the S?NH (nucleophilic aromatic substitution of hydrogen) methodology. Direct heteroarylation of phenol (resorcinol) fragments in polymer chains with 1,2,4-triazine derivatives illustrates a new synthetic method in the polymer chemistry. The feature of this methodology is that it provides an opportunity to accomplish direct one-pot polymer transformations by incorporating of rather complicated chelating groups through the displacement of hydrogen in phenol moieties. It has been shown that in order to obtain chemically modified polymers on the basis of phenol-formaldehyde and resorcinol-formaldehyde resins with a high degree of substitution with chelating units, a polymer matrix has to react with 3-(pyridin-2'-yl)-1,2,4-triazin-5(2H)-one. Also, it has been found that polymer sorbents with a high selectivity can be obtained by using the template method. Targeted synthesis of model compounds, as structural units of the chelating polymers, and elucidation of the structure of their complexes with copper (II) ions have shown that the most plausible type of coordination is formation of the bridge 1 : 1 complexes of the a,a'-bipyridinyl type.