Google Books: How can I import a list of books from the XML file I exported from My Library?

StackOverflow https://stackoverflow.com/questions/16348441

  •  14-04-2022
  •  | 
  •  

문제

According to the My Library FAQ, I can export my bookshelf as XML by following these instructions:

When viewing any bookshelves within 'My library' on Google Books, simply select Export as XML to download that bookshelf file.

However, when I want to import a list of books I must use a list of ISBN numbers by following these instructions:

When viewing any bookshelves within 'My library' on Google Books, click Options, then select Add by ISBN or ISSN. Enter one ISBN or ISSN per line, and click the Add books button when you are done.

How can I use the XML file I exported from My Library in order to import my books (maybe because I'm switching accounts and want to transfer my library)?

도움이 되었습니까?

해결책

If you have Python installed, you can run this script, which will print out every ISBN number found in each XML file in the current directory.

import glob
for xml in glob.glob('*.xml'):
    with open(xml) as f:
        for line in f:
            line = line.strip()
            if line.startswith('<value>'):
                # ISBN number is between the <value>...</value> tags.
                print line[7:-8]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top