View Single Post
Old 08-07-2018, 05:32 PM   #1142
Iceybones
Junior Member
Iceybones began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle PW3
I think I've narrowed it down to this block of code. Thoughts?

Quote:
Code:
goodreads_edition_book['goodreads_isbn'] = ''
            isbn_node = edition_data_node.xpath('div[@class="moreDetails hideDetails"]/div[@class="dataRow"][2]/div[@class="dataValue"]/span[@class="greyText"]/text()')
            if len(isbn_node) > 0:
                isbn = None
                match_isbn = re.search(': (\d+)', isbn_node[0])
                if not match_isbn:
                    match_isbn = re.search('(\d+)', isbn_node[0])
                if match_isbn:
                    isbn = match_isbn.groups(0)[0]
                    if check_isbn(isbn):
                        goodreads_edition_book['goodreads_isbn'] = isbn
            goodreads_edition_books.append(goodreads_edition_book)

Last edited by PeterT; 08-07-2018 at 07:19 PM. Reason: added code block to preserve indentation
Iceybones is offline   Reply With Quote