使用 importxml 获取指定图像 link 时出现问题

Problem with getting specified image link using importxml

我是导入新手xml,我在使用导入xml 将产品数据抓取到 Google 电子表格时遇到问题。

网页上的图片元素如下:

<div class="pd-img"><img src="https://img-trendyol.mncdn.com/Assets/ProductImages/oa/47/4778846/1/1032019101285_2_org.jpg" alt="" style="width: 78px; height: 114px; min-width: 78px; min-height: 114px;"></div>

当我尝试导入时 "//div[contains(@class,'pd-img')]/img/@src" 它根本 return 图像 link

阅读页面源代码后,我发现这个 xml 查询:

"//div/img/@src"

会 return link 它给了我 link 但重复了并且与之前的 4 个语句一起(总共 6 个单元格) 我正在使用的产品 link:https://www.trendyol.com/u-s-polo-assn/erkek-gomlek-g081sz004-000-855736-p-4778846?fbclid=IwAR1pOVpTNOyelKsgVpTQZJ0FRrb_37R-HlI_gm0XWb_ka9RaPGTO8JZZpZc

我明确需要的是一个 importxml 函数,它只会 return 仅来自产品页面的产品图片。

也许试试:

=QUERY(IMPORTXML(
 "https://www.trendyol.com/u-s-polo-assn/erkek-gomlek-g081sz004-000-855736-p-4778846?fbclid=IwAR1pOVpTNOyelKsgVpTQZJ0FRrb_37R-HlI_gm0XWb_ka9RaPGTO8JZZpZc", 
 "//div/img/@src"), 
 "where Col1 starts with 'http' limit 1", 0)