我有一个要求,我需要使用 Python 写入 excel 单元格,我将从网页收集的数据。
但没有选择如何做到这一点。
你们有什么想法吗?
根据@Marcin 的评论,这里是我正在寻找的更明确的要求
为什么需要python?->是的,我正在使用 Python 和 Beautiful Soup 模块从网页中获取数据。
excel在哪里运行,或者根本就在运行?->当脚本从网页完成其数据收集时需要 Excel,并将尝试到下一页执行相同的任务,我希望将当前数据保存为 excel 格式。
这与网络有什么关系?你到底想达到什么目的? 希望对您的上述问题给出这个答案。
您可以只使用 CSV 文件吗? 是的,我可以使用它,但我的最终目标是将数据推送回数据库,可以是 Oracle 或 Access 数据库。
建筑学
------------------
| web |
| page |
------------------
|
|
|
Python and BS4(Data Extraction)
|
|
|
------------------
| Excel |
| data |
------------------
|
|
|
Python to Push Data(Oracle/Access)
|
|
|
------------------
| Any |
| DB |
------------------
编辑
根据@Thang
我试过但收到错误:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Happy>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32com.client
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named win32com.client
>>>