[英]Google Sheet Web-scraping ImportXml Xpath on Yahoo Finance
I am trying to get stock information from Yahoo Finance with webscraping ImportXml Xpath,into my Google Sheet.我正在尝试通过网页抓取 ImportXml Xpath 从 Yahoo Finance 获取股票信息,并将其放入我的 Google 表格中。 I can get it to work with the %change, but not with the price, there I get a number I dont reconize anywhere on the page, can anybody pleas help me.
我可以让它与 %change 一起使用,但不能与价格一起使用,在那里我得到了一个我在页面上任何地方都没有重新计算的数字,任何人都可以帮助我。 My xmlImport for my Price look like this:
我的价格的 xmlImport 如下所示:
=INDEKS(IMPORTXML("https://finance.yahoo.com/quote/CVNA?p=CVNA";"//*[@id='quote-header-info']/div[3]/div[1]/div/span[1]");1)
And my xmlImport for my %Change look like this我的 %Change 的 xmlImport 看起来像这样
=INDEKS(IMPORTXML("https://finance.yahoo.com/quote/CVNA?p=CVNA";"//*[@id='quote-header-info']/div[3]/div[1]/div/span[2]");1)
try:尝试:
=REGEXEXTRACT(INDEX(IMPORTXML(
"https://finance.yahoo.com/quote/CVNA?p=CVNA";
"//*[@id='quote-header-info']");;3); "\d+.\d+|\d+")+0
=SUBSTITUTE(REGEXEXTRACT(INDEX(IMPORTXML(
"https://finance.yahoo.com/quote/CVNA?p=CVNA";
"//*[@id='quote-header-info']");;3); "\d+.\d+|\d+"); "."; ",")*1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.