xml - Google 表格中的 IMPORTXML 语法问题
问题描述
我正在尝试导入
https://www67.myfantasyleague.com/2019/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0
进入谷歌工作表并清理它,使其成为三列,一列 for player id
, nextname
和 next team
。
我已将公式输入到谷歌表格中,我认为它应该如何工作,但我的语法错误,因为我得到了错误
导入的内容为空。
我没有针对正确的数据,我不确定如何在这里准确地做到这一点。
我使用的公式是:
=IMPORTXML("https://www67.myfantasyleague.com/2019/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0","//span[@class='html-attribute-value']")
=IMPORTXML("https://www67.myfantasyleague.com/2019/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0","//span[@class='html-attribute-value']")```
=IMPORTXML("https://www67.myfantasyleague.com/2019/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0","//span[@class='html-attribute-value']")```
解决方案
尝试:
=ARRAYFORMULA(IFERROR(QUERY({
REGEXEXTRACT(INDEX(IMPORTDATA("https://www67.myfantasyleague.com/2019/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0"),,1), "id=""(.+?)"""),
REGEXEXTRACT(INDEX(IMPORTDATA("https://www67.myfantasyleague.com/2019/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0"),,1), "name=""(.+)")&" "&
REGEXEXTRACT(INDEX(IMPORTDATA("https://www67.myfantasyleague.com/2019/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0"),,2), "(.+?)"""),
REGEXEXTRACT(INDEX(IMPORTDATA("https://www67.myfantasyleague.com/2019/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0"),,2), "team=""(.+?)""")},
"offset 3")))
电子表格演示
推荐阅读
- c# - c#驱动程序连接到副本集洪水mongodb.log with Authentication failed on arbiter
- django - 基于 Django 类的视图 - 如果用户已通过身份验证,则为 ListView,如果用户未通过,则为 FormView,相同的 URL
- python - PYTHON 中的错误变量分配
- ios - iOS:ibeacon 唤醒后恢复 BLE 连接
- python - 从另一个 csv 文件添加列
- c - 如何等待一点设置?
- html - 具有特殊文件名的 IIS?
- json - Asp Net Core API 返回截断的 Json
- java - 无法在 vuejs + spring boot 中加载字体 el-icon
- java - 活动可见时禁用 StartApp SDK 自动展示广告