Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

xml - importxml function in google sheets not working for specific website

I'm trying to use importxml function in google sheets to import a price for a specific kind of security which is called a structured note. Many banks offer these products and it has been working for most of the different bank websites. What I'm doing is highlighting the price, clicking inspect, then right clicking on the specific line and choosing copy->xpath. Then in google sheets I insert the link into one cell, call it A1, and I insert the xpath into B1. Then in C1 I am doing =importxml(A1,B1). Like I said it works for most other bank websites. But for some reason it's just not working with TD. Any help would be greatly appreciated. I am looking for the closing bid price per note. Currently that value is 134.18. Here is the link: https://www.tdstructurednotes.com/snp/noteDetails.action?noteId=1471 Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The website you are trying to import() is controlled by JavaScript. Thus, import() functions from google sheets won't be able to fetch the data for you. You may not be able to notice it at first but when landed on the 'I Agree' webpage, the buttons will not be clickable when you turn JavaScript to 'Block'(Click lock icon beside address bar->Go to site settings->Set JavaScript to 'Block' and reload website using incognito for this case) for that website.

I suggest finding another source of data that gives the same data.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...