Google Sheets IMPORTXML - 抓取参展商列表

问题描述 投票:0回答:1

公司名称屏幕截图:尝试为我的 CRM(Google 表格)抓取公司名称,但出现公式解析错误。

网站https://exhibitormanual.oceanbusiness.com/

尝试将子/类更改为 xpath quary 参数。也尝试过 IMPORTHTML。

使用的代码: =importxml("https://exhibitormanual.oceanbusiness.com/","//*[@id="drts-platform-render-66fc2684827da-2-post-20696"]/div/div/div[2]/ div1/a")

公式解析错误。

google-sheets web-scraping scripting
1个回答
0
投票

这是一种将

293 company names
拉到两页的方法;一些不需要的标题(前 11 名)也被拉出。如果您想要更有针对性的 xpath,您可以修改代码:

=reduce(tocol(,1),sequence(2),lambda(a,c,vstack(a,importxml("https://exhibitormanual.oceanbusiness.com/?_page="&c&"&num=200&sort=post_title","//*[@title]"))))

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.