简体   繁体   English

Googlesheets function - IMPORTXML Xpath Yahoo Finance 中列文本的困难

[英]Googlesheets function - IMPORTXML Xpath difficulties for column text within Yahoo Finance

Creating a ticker scanner tool on googlesheets with mainly google finance and yahoo finance.在 googlesheets 上创建一个股票扫描仪工具,主要是 google Finance 和 yahoo Finance。 No difficulties with index(importhtml()) and other functions however I can't manage to find the correct Xpath when using importxml. index(importhtml()) 和其他功能没有困难,但是在使用 importxml 时我无法找到正确的 Xpath。 I have no background in html or Xpath so I am a novice but I understand the basics behind it from troubleshooting recently.我没有 html 或 Xpath 的背景,所以我是新手,但我最近从故障排除中了解了它背后的基础知识。

URL: https://au.finance.yahoo.com/quote/FMG.AX?p=FMG.AX URL: https://au.finance.yahoo.com/quote/FMG.AX?p=FMG.AX

I am trying to pull in text information about SECTOR, INDUSTRY and the DESCRIPTION which is on the right hand side (about half way down the page).我正在尝试提取右侧的有关部门、行业和描述的文本信息(大约在页面的一半处)。 It seems to be within a column which may be causing me trouble.它似乎在可能给我带来麻烦的列中。 Using Chrome inspect to retrieve XML but also tried several chrome extensions which didn't work either.使用 Chrome 检查来检索 XML 但也尝试了几个也不起作用的 chrome 扩展。

This is what I got when copying Xpath (short and long versions)这是我在复制 Xpath(短版和长版)时得到的

Sectors: //*[@id="Col2-11-QuoteModule-Proxy"]/div/div/div/div/p[2]部门://*[@id="Col2-11-QuoteModule-Proxy"]/div/div/div/div/p[2]

Business Summary: /html/body/div[1]/div/div/div[1]/div/div[3]/div[2]/div/div/div/div/div/div[12]/div/div/div/div/div/p业务总结:/html/body/div[1]/div/div/div[1]/div/div[3]/div[2]/div/div/div/div/div/div[12]/div /div/div/div/div/p

Also tried shortening the /div with //p but doesn't work anyway.还尝试使用//p 缩短/div,但无论如何都不起作用。

I played around and used //body/div//div/p which retrieved news data from the middle of the page.我到处玩并使用 //body/div//div/p 从页面中间检索新闻数据。

Wondering if someone could help me adjust or explain what I am doing wrong and point me in the right direct.想知道是否有人可以帮助我调整或解释我做错了什么,并指出我正确的方向。 Any help would be greatly appreciated.任何帮助将不胜感激。 Thank you so much to anyone that takes a look!非常感谢任何看的人!

this will never work with IMPORTXML / IMPORHTML formulae because elements you are trying to import are controlled by JavaScript which google sheets can't process.这永远不会与IMPORTXML / IMPORHTML公式一起使用,因为您尝试导入的元素由谷歌表格无法处理的 JavaScript 控制。

在此处输入图像描述

Apparently, the data you are trying to pull is controlled by JavaScript which means you won't be able to fetch it using IMPORTXML.显然,您尝试提取的数据由 JavaScript 控制,这意味着您将无法使用 IMPORTXML 获取它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Googlesheets function - IMPORTXML Xpath 用于 Yahoo Finance 中的文本 - 返回错误值 - Googlesheets function - IMPORTXML Xpath for text within Yahoo Finance - returning wrong value 使用ImportXML googlesheets函数,我可以在xpath查询参数中引用单元格吗? - Using the ImportXML googlesheets function, can I reference a cell within my xpath query argument? IMPORTXML 未从雅虎财经统计页面提取数据 - IMPORTXML Not Pulling Data From Yahoo Finance Statistics Page 无法使用 Google 表格从 Yahoo Finance 导入 XML 自由现金流 - Unable to IMPORTXML Free Cash Flow from Yahoo Finance using Google Sheets 使用 =IMPORTXML 和 xPath 查找文本值,包括过滤器 - Find text value with =IMPORTXML and xPath including filter 为Google importXML函数编写XPath查询 - Writing an XPath query for Google importXML function 如何在Google文档中使用ImportXML XPath concat? - How to use ImportXML XPath concat within Google Docs? 在PHP填充的网站上使用importXML并抓取到googlesheets - Using importXML with a php populated website and scraping to googlesheets 从格式化的 XML(不是 html)在 googlesheets 中导入xml - importxml in googlesheets from formatted XML (not html) Google电子表格中的Xpath或Importxml - Xpath or Importxml in google spreadsheet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM