2

I want to grab some lists of data from various pages on the web and I'm using IMPORTXML to do it.

Assume I have a list of URLs in column D.

Depending on the URL, the length of the results can be different and I want to have them all in a single contiguous column.

In A1, I've found that the formula

={IMPORTXML(D1, xpath);IMPORTXML(D2, xpath)}

works for the two URLS in D1 and D2, but I want to be able to pull this off if I have many more URLs listed in the D column.

Going to start with about 10 URLs and add more later, and I will do this with more than one xpath for multiple columns to build out a sheet to do lookups on.

I'd like to just be able to refer to D:D, and I tried that with ARRAYFORMULA(), for example:

=ARRAYFORMULA(IMPORTXML(D:D, xpath))

Did not work. I thought that would perform the IMPORTXML for each element in the column. It only included the URL in D1.

I'm hoping for a sensible option that won't require that I expand the first formula to keep repeating the IMPORTXML for every row in D, and then as I add URLs later, to have to keep extending the array.

0

1 Answer 1

1

Not all the Google Sheets functions are able to work with ArrayFormula. Looks that the import functions (IMPORTDATA,IMPORTHTML,IMPORTRANGE, IMPORTXML) are this kind of functions. A similar answer https://webapps.stackexchange.com/a/89290/88163 to a similar question Use of importdata with arrayformula

Other related questions

Not the answer you're looking for? Browse other questions tagged or ask your own question.