vba 自动化 Excel 从 web url 获取数据

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9576542/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 12:43:26  来源:igfitidea点击:

Automate Excel to fetch data from web url

excelexcel-vbaurlvba

提问by 2FaceMan

For example lets take imdb(movie rating) website-I have an excel sheet with 10K movie name in column A

例如,让我们以 imdb(电影评级)网站为例- 我在 A 列中有一个包含 10K 电影名称的 Excel 表格

I copy a name from sheet- Search it in url (http://www.imdb.com/) in search box.- Copy the result(rating / actors) & paste in the sheet at column B,C,D

我从工作表中复制一个名称-在搜索框中的 url (http://www.imdb.com/) 中搜索它。- 复制结果(评级/演员)并粘贴到 B、C、D 列的工作表中

Is there a way I can automate this process.

有没有办法可以自动化这个过程。

Note:the URL I have to use requires login id/password.

注意:我必须使用的 URL 需要登录 ID/密码。

回答by Malk

Excel can connect to web pages to get data. This can be utilized in your code with VBA, external .qry file, or using the 'get external data' interface. Check this link http://msdn.microsoft.com/en-us/library/aa203721(v=office.11).aspx

Excel 可以连接到网页以获取数据。这可以在带有 VBA、外部 .qry 文件或使用“获取外部数据”接口的代码中使用。检查此链接http://msdn.microsoft.com/en-us/library/aa203721(v=office.11​​).aspx