Google Sheet:基于IMPORTHTML多页面表格匹配提取指定列数据
Google Sheets 多页面表格匹配提取解决方案需求
我已通过以下公式成功获取第一个URL(共57页)的完整表格数据:
=arrayformula( lambda( baseUrl, pageStart, pageEnd, query( reduce( importhtml(baseUrl & pageStart, "table"), sequence(pageEnd - pageStart, 1, pageStart + 1), lambda( result, pageNumber, { result; iferror( importhtml(baseUrl & pageNumber, "table"), iferror(sequence(1, 11) / 0) ) } ) ), "where Col1 is not null", 1 ) )( "https://www.screener.in/screens/881782/rk-all-stocks/?limit=25&page=", 1, 57 ) )
现需处理第二个包含165+页表格的URL,要求以第一个表格的Col2列值为匹配项,提取第二个表格对应行的Col12和Col13数据,添加至第一个表格的ROCE列右侧。
我当前使用的公式仅能获取第二个URL的第一页数据,公式如下:
=BYROW(B2:B,LAMBDA(bx,IF(bx="",,IFNA(QUERY(IMPORTHTML("https://www.screener.in/screens/881791/rk-holding/?page=1", "table",1),"Select Col12, Col13 Where Col2='"&bx&"'",0)))))
寻求可实现多页面匹配提取的Google Sheet公式解决方案。
内容的提问来源于stack exchange,提问作者Solanki Rajesh
相关产品推荐
相关产品推荐

