开发者

How to get specific texts from the URL put on MS Excel cell?

开发者 https://www.devze.com 2023-04-05 22:57 出处:网络
I want to build the database which gets the url from user in one cell and returns some texts to the other cells.开发者_如何学运维 The Url is from www.imdb.com. I saw it was possible on Google Spreadsh

I want to build the database which gets the url from user in one cell and returns some texts to the other cells.开发者_如何学运维 The Url is from www.imdb.com. I saw it was possible on Google Spreadsheet. I am wondering if it's possible for MS Excel.

Like when I input a movie Url, it gets ratings,title, casts from IMDB page.


You can get pretty close using a IQY file to define the web query and the parameters a user should input. The only difference is that, rather than defining the movie id in a cell, your user will be prompted when they create or refresh a query.

To do this, you need to:

  1. create a plain text iqy file. Call it "imdb-movie.iqy" or something.
  2. Put this text in it:
WEB
1
http://www.imdb.com/title/["Movie ID"]/

Selection=3
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
  1. In the "Get External Data pane of the Excel Data ribbon click "Existing Connections" and find your IQY file. It will ask you where to put the data and prompt you for the movie id. By right clicking, you can see lots of settings about formatting and such.

The "selection=3" entry in the IQY file determines what table to pull the data in from. It sounds like you may want a number of them.

To make your own IQY file, you can choose the "get external data/from web" and select which table to use. Then choose "save" from the dialog and you have the file. You can paramaterize it with the ["parameter name","prompt"] syntax.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号