Getting fields' Attributes in node template
The field values in node are the raw data from the database. You should not use them for output. They are great for coding of conditions in twig.

For output use:

{{ content.field_1 }}
{{ content.field_2 }}


These statements will output the fields using the field formatter as configured in the ui. 

Edit: Adding attributes

If you need additional attributes add them in the field twig. The methods described in the link you provided in the question are only possible in the same twig your element comes from. If you want to modify the attributes of the node it is the best to do it in the node template. If you want to add attributes to the field use the field template.