Last edited time
Dec 24, 2023 02:14 PM
summary
IMPORTXML导入表格数据
- 获取该页面下所有的表格
- 获取特定表格 `
使用完整的Xpath
`
=importxml("
https://brokers.fx110.com/broker/1338","//html/body/div[5]/div/div[2]/div[2]/div/div/div/table/tbody/*
")
- 获取表格的某个单元格 注意是
//
开头
=importxml("https://brokers.fx110.com/broker/1338","//html/body/div[5]/div/div[2]/div[2]/div/div/div/table/tbody/*")
通过@class来导入单个元素
公式格式:
=IMPORTXML("https://www.yourwebsite.com/","XPATH")
导入H2标签
使用公式 =IMPORTXML("https://www.yourwebsite.com/", "XPATH")
导入 h1 标题的公式是
=importxml("https://en.wikipedia.org/wiki/Spreadsheet","//h1")
对于 h2:
=importxml("https://en.wikipedia.org/wiki/Spreadsheet","//h2")
对于 h3:
=importxml("https://en.wikipedia.org/wiki/Spreadsheet","//h3”)
将网页的元描述导入 Google Sheets
=importxml("https://www.lido.app/","/html/head/meta[@name='description']/@content")
将网页标题导入 Google Sheets
使用公式
=IMPORTXML("https://www.yourwebsite.com/", "XPATH")
计算公式为
=importxml("https://www.lido.app/","//title")
公式总结
=IMPORTXML("URL", "xpath")
=importxml("https://en.wikipedia.org/wiki/List_of_spreadsheet_software","//div[contains(@class,'toc')]/ul/li/*"
//title标签
总结
- 作者:开户通
- 链接:https://fx.ssgg.net/imports-googlesheets
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。