Reputation: 1163
I have the following in my Google Sheet to pull number of views from a YouTube page:
=IMPORTXML("https://www.youtube.com/watch?v=i1D8XIIvYS0","//div[@class='watch-view-count']")
I'd like to split out the YouTube ID into a different column and do the following where B2 is the cell with the value 'i1D8XIIvYS0'
=IMPORTXML("https://www.youtube.com/watch?v=B2","//div[@class='watch-view-count']")
How do I escape 'B2' so that the value is used here?
Upvotes: 0
Views: 64
Reputation: 5509
=IMPORTXML("https://www.youtube.com/watch?v="&B2,"//div[@class='watch-view-count']")
If your referencing b2 you just need to remove the quote from after it to in front of it and use the &
to join the value with the string
Upvotes: 1
Reputation: 10259
Try:
=IMPORTXML("https://www.youtube.com/watch?v="& B2 &"","//div[@class='watch-view-count']")
Upvotes: 0