我如何使用ImportXML返回数据到单独的列谷歌电子表格?



我在Google电子表格中使用ImportXML从网站https://www.socialexplorer.com/profiles/essential-report/zcta5-48105.html输入人口统计数据。我想将人口、平方英里和每平方英里的人数提取到结果的三列显示中。

目前,我通过限制这三行来做到这一点:

=QUERY(ARRAYFORMULA(IMPORTXML("https://www.socialexplorer.com/profiles/essential-report/zcta5-48105.html", "//div[contains(@class,'c-num')]")),"select * limit 4",-1)

但是输出结果是

N population
N square miles
N people per square mile 

我想让它看起来像

Population   Square Miles     People Per Square Mile
N               N                      N

有办法让我创建这个显示吗?

理想情况下,我将能够输出字段中位数年龄,学士学位或更高,人均收入等。

你可以试试:

=TRANSPOSE(QUERY(ARRAYFORMULA(IMPORTXML("https://www.socialexplorer.com/profiles/essential-report/zcta5-48105.html", "//div[contains(@class,'c-num')]")),"select Col2,Col1 limit 4",-1))

相关内容

最新更新