+ Reply to Thread
Results 1 to 3 of 3

Scraping data from Last.fm in Google Docs

  1. #1
    Registered User
    Join Date
    10-23-2014
    Location
    Denmark
    MS-Off Ver
    2013
    Posts
    14

    Scraping data from Last.fm in Google Docs

    Hi Everyone,


    I have quite wide taste in music with a keen interest in everything from jazz in the late 20s, to punk rock, Mozart, cheesy pop music, and much, much more obscure stuff.

    For that reason it often feels a little Schizophrenia-ish to go through my favourite tunes on Spotify. I'm therefore trying to organise my favourite artists by genre and other tags from Last.fm, but I have faced a problem.

    When I try to scrape data from Last.fm, I get the error "Important XML content cannot be parsed" for my formula: "=importxml(B1, "//ul@[class'tags tags--global'/li")=importxml(B1, "//ul@[class'tags tags--global'/li")"

    Have I done anything wrong or is it just not possible?

    The document can be seen here:

    https://docs.google.com/spreadsheets...73A/edit#gid=0

    Any help is much appreciated.

    Best Regards,
    Peter
    Last edited by peterromer; 05-20-2016 at 11:06 AM.

  2. #2
    Forum Contributor amit.wilson's Avatar
    Join Date
    07-09-2013
    Location
    Gotham
    MS-Off Ver
    Excel for Mac 2011
    Posts
    283

    Re: Scraping data from Last.fm in Google Docs

    Hi Peter,

    the xpath in your formula wasn’t quite correct.

    The correct xpath is "//ul/li[@class='tag']"

    So the formula in C1 is this:

    =importxml(B1,"//ul/li[@class='tag']")
    The data output from this formula is in a column.

    To get it in a row, try:

    =transpose(importxml(B1,"//ul/li[@class='tag']"))
    Have made this change in your Google sheet.

    Cheers

    PS: The "ADHD, Yahya Hassan" row shows an error because the page on last.fm is blank
    <-- If you're happy & you know it...click the star.:-)

  3. #3
    Registered User
    Join Date
    10-23-2014
    Location
    Denmark
    MS-Off Ver
    2013
    Posts
    14

    Re: Scraping data from Last.fm in Google Docs

    Thanks Amit!

    This is so cool! I can't wait to play around with the many possibilities there is.

    Good weekend!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Import from Google Docs
    By www.vyuka-excelu.cz in forum Excel General
    Replies: 0
    Last Post: 07-22-2015, 11:30 AM
  2. pull certain data from google docs form-produced spreadsheet to other docs
    By MisterCadillac in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 03-11-2014, 04:49 AM
  3. countifs in google docs
    By lolpopo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-09-2013, 09:21 PM
  4. read a value from google docs
    By ahmed471 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-18-2012, 05:07 PM
  5. (Google Docs) Finding Data - writing & sum
    By redcrystal in forum Excel General
    Replies: 4
    Last Post: 12-15-2011, 11:58 PM
  6. Google Docs
    By ianh in forum The Water Cooler
    Replies: 2
    Last Post: 06-11-2011, 02:11 PM
  7. Connect to Google Docs Spreadsheet as a data source?
    By Alabaster in forum Excel General
    Replies: 0
    Last Post: 01-13-2011, 01:48 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1