{"id":5531,"date":"2014-03-30T23:46:23","date_gmt":"2014-03-30T23:46:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/extracting-hyperlinks-from-excel-xlsx-with-python-collection-of-common-programming-errors\/"},"modified":"2014-03-30T23:46:23","modified_gmt":"2014-03-30T23:46:23","slug":"extracting-hyperlinks-from-excel-xlsx-with-python-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/extracting-hyperlinks-from-excel-xlsx-with-python-collection-of-common-programming-errors\/","title":{"rendered":"Extracting Hyperlinks From Excel (.xlsx) with Python-Collection of common programming errors"},"content":{"rendered":"<p>I have been looking at mostly the xlrd and openpyxl libraries for Excel file manipulation. However, xlrd currently does not support <code>formatting_info=True<\/code> for .xlsx files, so I can not use the xlrd <code>hyperlink_map<\/code> function. So I turned to openpyxl, but have also had no luck extracting a hyperlink from an excel file with it. Test code below (the test file contains a simple hyperlink to google with hyperlink text set to &#8220;test&#8221;):<\/p>\n<pre><code>import openpyxl\n\nwb = openpyxl.load_workbook('testFile.xlsx')\n\nws = wb.get_sheet_by_name('Sheet1')\n\nr = 0\nc = 0\n\nprint ws.cell(row = r, column = c). value\nprint ws.cell(row = r, column = c). hyperlink\nprint ws.cell(row = r, column = c). hyperlink_rel_id\n<\/code><\/pre>\n<p>Output:<\/p>\n<pre><code>test\n\nNone\n<\/code><\/pre>\n<p>I guess openpyxl does not currently support formatting completely either? Is there some other library I can use to extract hyperlink information from Excel (.xlsx) files?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been looking at mostly the xlrd and openpyxl libraries for Excel file manipulation. However, xlrd currently does not support formatting_info=True for .xlsx files, so I can not use the xlrd hyperlink_map function. So I turned to openpyxl, but have also had no luck extracting a hyperlink from an excel file with it. Test [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5531","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5531"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5531\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}