image - 如何使用 IMPORTXML 导入图像
问题描述
从网站导入:https ://weather.interia.com/long-term-forecast-chicago,cId,49700
我正在尝试在以下类中导入图像 URL 列表:
单元格中的 URLA1
我试过使用
=IMPORTXML($A$1, "//img/@src")
虽然这确实会导入一些图像,但它不会导入所需的图像。
解决方案
你能做的最好的就是:
=ARRAYFORMULA(IMAGE("https://weather.interia.com/i/icons-bg-light-2/"&ROW(A1:A60)&".png",3))
更新:
=ARRAYFORMULA(IMAGE("https://weather.interia.com/i/icons-bg-light-2/"&
IFNA(VLOOKUP(IMPORTXML(
"https://weather.interia.com/long-term-forecast-chicago,cId,49700",
"//span[@class='weather-forecast-longterm-list-entry-forecast-phrase']"), {
"Showers" , 12;
"Partly sunny" , 3;
"Cold" , 31;
"Mostly cloudy" , 6;
"Dreary" , 8;
"Cloudy" , 7;
"Mostly cloudy" , 8;
"Mostly sunny" , 2;
"Intermittent clouds", 4;
"Freezing rain" , 26;
"Flurries" , 19;
"Sunny" , 1;
"Hazy sunshine" , 5;
"Snow" , 22}, 2, 0))&".png", 3))
推荐阅读
- java - 插入排序arraylist,按字母顺序对数字和名称进行升序排序
- php - 我应该如何解决这个涉及 PHP 函数静态的错误?
- php - 卷曲+文件方案不返回 PHP 7.3+ 中的标头
- java - 检查hashmap(Key)中是否出现参数的方法
- c++ - 我在这里正确传递参数吗?
- swift - 如何使用 SwiftUI 为可隐藏视图设置动画?
- javascript - 更改 CircularProgress 的颜色和位置?
- spring-boot - Spring Boot 指标 http.client.requests 不适用于 WebClient 反应式应用程序
- amazon-web-services - 在 AWS Elastic Beanstalk 中使用 sqlite db 部署 Flask 应用程序
- php - Laravel 查询优化 (SQL)