def book_info(td):
 title = td.find('div', 'thumbheader').a.text
 by_author = td.find('div', 'AuthorName').text
 authors = [x.strip() for x in re.sub('^By ', '', by_author).split(',')]
 isbn_link = td.find('div', 'thumbheader').a.get('href')
 isbn = re.match('/product/(.*)\\.do', isbn_link).groups()[0]
 date = td.find('span', 'directorydate').text.strip()
 return {'title': title, 'authors': authors, 'isbn': isbn, 'date': date}

def book_info ( td ) : title = td . find ( 'div' , 'thumbheader' ) . a . text by_author = td . find ( 'div' , 'AuthorName' ) . text authors = [ x . strip ( ) for x in re . sub ( '^By ' , '' , by_author ) . split ( ',' ) ] isbn_link = td . find ( 'div' , 'thumbheader' ) . a . get ( 'href' ) isbn = re . match ( '/product/(.*)\\.do' , isbn_link ) . groups ( ) [ 0 ] date = td . find ( 'span' , 'directorydate' ) . text . strip ( ) return { 'title' : title , 'authors' : authors , 'isbn' : isbn , 'date' : date }
given a beautifulsoup <td> tag representing a book .