How to get specific texts from the URL put on MS Excel cell?
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:
- create a plain text iqy file. Call it "imdb-movie.iqy" or something.
- 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
- 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.
精彩评论