打开网页上的xls文件

import xlrd
import urllib.request

url = r'https://xx.xls'

if __name__ == '__main__':
    file_name, _ = urllib.request.urlretrieve(url)
    print(file_name)
    workbook = xlrd.open_workbook(file_name)
    table = workbook.sheet_by_index(0)
    print(table.cell(1, 1).value)

你可能感兴趣的:(打开网页上的xls文件)