我收到了这个警告WARNING: C:\Users\diodi\AppData\Local\Programs\Python\Python37-32\lib\site-packages\xlsxwriter\worksheet.py:923: UserWarning: Ignoring URL 'https://www.google.com/search?q=hello+world' since it exceeds Excel's limit of 65,530 URLS per worksheet. "65,530 URLS per worksheet." % force_unicode(url))
我用来写抓取数据的输出
#spider.found_items is a list of dictionary
df = pd.DataFrame(spider.found_items)[ordered_list] #ordered_list is the order of dictiornary outputed
df.to_excel("{}.xlsx".format(file_name),sheet_name='All Products')
我检查了这个Number of URLS is over Excel's limit of 65,530 URLS per worksheet.,但它将链接格式化为字符串(不可点击)。如果我可以写到多张工作表或任何其他建议,有没有办法保留URL (作为链接)?
发布于 2019-05-26 17:57:41
从根本上说,这是Excel的一个限制。它只允许每个工作表有65,530个唯一的* urls。没有任何解决方法可以解决这个问题。
(*) Excel允许超过65,530个非唯一urls (如果它们连续分组)。例如,针对65,530的限制,小区A1到A100中的相同url将仅被计为一个url。但是,XlsxWriter不支持对urls进行分组以利用这一点(即使是这样,如果所有urls都是唯一的或不连续的,也没有帮助)。
https://stackoverflow.com/questions/56303009
复制相似问题