2

I am trying to use =IMPORTXML and Xpath (Using the Selector Gadget Chrome extension since I am new to coding and XML is pretty daunting) to copy the number of followers of a given page to a Google Sheet. Ideally i would love to do this for thousands of accounts that i keep track of.

I have been following a guide which explained how to do this on Twitter and I am trying to adapt it to Soundcloud. My concerns are:

  1. Selecting the right URL from which to source the information

  2. Getting the right Xpath code

This is my entire code, which gets a formula parse error when executed on google sheets:

=IMPORTXML("https://soundcloud.com/codexnaturae", "//*[contains(concat( " ", @class, " " ), concat( " ", "sc-border-light-right", " " )) and (((count(preceding-sibling::*) + 1) = 1) and parent::*)]//*[contains(concat( " ", @class, " " ), concat( " ", "sc-font-tabular-light", " " ))])")

Broken down:

1.URL

=IMPORTXML("https://soundcloud.com/codexnaturae",

2.X-Path as per Selector Gadget

Selector Gadget Interface

//*[contains(concat( " ", @class, " " ), concat( " ", "sc-border-light-right", " " )) and (((count(preceding-sibling::*) + 1) = 1) and parent::*)]//*[contains(concat( " ", @class, " " ), concat( " ", "sc-font-tabular-light", " " ))]

I have looked at A similar issue but with radically different x-path and no shown on the post.

Any help would be greatly appreciated. Even just pointing me in the right direction. Thank you so much in advance.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
olivimot
  • 21
  • 1

0 Answers0