简体   繁体   English

谷歌表importxml xpath查询

[英]Google sheet importxml xpath query

I'm trying to get the data for "Next Earnings Announcement" for this http://www.bloomberg.com/quote/1880:HK site. 我正在尝试为此http://www.bloomberg.com/quote/1880:HK网站获取“下一次收入公告”的数据。

I have tried 我努力了

=ImportXml( "http://www.bloomberg.com/quote/1880:HK", "//span[@class='company_stat']" )

=ImportXml( "http://www.bloomberg.com/quote/1880:HK", "/html/body/div[2]/div[1]/div[1]/div[2]/div[2]/div[2]/div[1]/div[1]/div[3]/table/tbody/tr[16]/td/text()" )

getting a #N/A , want 10/27/2014 as result 得到10/27/2014 #N/A ,想要10/27/2014作为结果

可以使用一个有用的方法来代替脆弱而可怕的XPath表达式:

//th[normalize-space() = 'Next Earnings Announcement']/following-sibling::td

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM