You are reading from file now,
Do
Document
attribute is only in use when read from string. Do
print(dir(doc))
to see what attributes you can use with doc...
.