Answer the question
In order to leave comments, you need to log in
How to read doc file from a link?
Good afternoon. Task: read the doc-file from the link.
import requests as req
from io import BytesIO
# иногда сайт ругается на ssl, поэтому пусть этот кусочек тоже тут будет для нормальной работы
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
# тело скрипта
url ='https://www.uralprombank.ru/files/misc/admiralgorshkov-15.doc'
file = req.get(url, verify=False).content
file = BytesIO(file).read()
file = file.decode('cp65001', 'ignore')
print(file)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question