Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 写入excel文件时超过URL数_Python_Excel_Pandas - Fatal编程技术网

Python 写入excel文件时超过URL数

Python 写入excel文件时超过URL数,python,excel,pandas,Python,Excel,Pandas,我收到了这个警告警告:C:\Users\diodi\AppData\Local\Programs\Python\Python37-32\lib\site packages\xlsxwriter\worksheet.py:923:UserWarning:忽略URL'https://www.google.com/search?q=hello+“world”,因为它超过了Excel每个工作表65530个URL的限制。 “每个工作表有65530个url。”%force_unicode(url)) 我用它

我收到了这个警告
警告:C:\Users\diodi\AppData\Local\Programs\Python\Python37-32\lib\site packages\xlsxwriter\worksheet.py:923:UserWarning:忽略URL'https://www.google.com/search?q=hello+“world”,因为它超过了Excel每个工作表65530个URL的限制。
“每个工作表有65530个url。”%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')

我选中了这个,但它将链接格式化为字符串(不可单击)。如果我可以写多张工作表或任何其他建议,有没有办法保留URL(作为链接)?

基本上这是Excel的限制。每个工作表只允许65530个唯一*URL。没有任何解决办法


(*)如果连续分组,Excel允许超过65530个非唯一URL。例如,单元格A1至A100中的同一url将仅被视为一个url,与65530限制相对应。然而,XlsxWriter不支持利用URL分组(即使是这样,如果所有URL都是唯一的或不连续的,也没有帮助)。

您是否检查了@shaikmoeed的可能重复项?我不相信这会解决问题,@shaikmoeed这基本上将字符串转换为URL,而excel不允许超过每页“65530”链接