Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Spreadsheets Importxml output into one cell

I'm scraping the users from a community using google spreadsheets importxml function.

Cell=A1

http://inbound.org/members/all/top?&per_page=48

Cell=B1

=IMPORTXML(A1,"//div[@class='title name']//a/@href")

When I use the b1 formula to scrape the users, the output is across 48 cells in column B. Is there a way I can customize the output? I have lots of inbound pages on cell A1 that I want to apply the formula to by pulling the drop down tag on B1 to apply the formula to each url on A1, but I can't do this because the B column is already filled with the first scrape.

Is there a way to put all usernames scraped into just B1 separated by commas?

I tried A:A to see if it would scrape all urls from column A in one go, but I guess that doesn't work.

=IMPORTXML(A:A,"//div[@class='title name']//a/@href")
like image 844
jackssuited Avatar asked Feb 10 '23 15:02

jackssuited


1 Answers

Why to write a script function? There are build in JOIN in Google Spreadsheets

=JOIN(CHAR(10), IMPORTXML(A1,"//div[@class='title name']//a/@href"))

CHAR(10) is for new line character

like image 200
Liphtier Avatar answered Feb 15 '23 21:02

Liphtier