You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

请求协助获取上传下载速度值的正确XPath(适配IMPORTXML函数)

获取测速页面上传/下载速度的XPath(适配Google Sheets IMPORTXML)

通用XPath示例(针对常见测速页面结构)

  • 下载速度
    若页面元素用download-speed类标识速度值:

    //span[@class='download-speed']/text()
    

    若数值与单位分离,取数值节点:

    //div[contains(@class, 'result-download')]//span[@class='speed-value']/text()
    
  • 上传速度
    对应upload-speed类的节点:

    //span[@class='upload-speed']/text()
    

    分离式结构的数值节点:

    //div[contains(@class, 'result-upload')]//span[@class='speed-value']/text()
    

实用技巧

  • 用浏览器开发者工具(F12)定位目标元素,右键复制相对XPath或完整XPath,直接代入IMPORTXML测试
  • 若页面是JS动态渲染的内容,IMPORTXML无法抓取,需改用IMPORTJSON或先抓取静态源码再解析
  • Google Sheets公式示例:
    =IMPORTXML("你的测速页面URL", "//span[@class='download-speed']/text()")
    

内容的提问来源于stack exchange,提问作者Mr. Explorer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 03:15:42