from ox.cache import read_url from ox import find_re, strip_tags import re base = 'http://www.lookupbyisbn.com' def get_data(isbn): r = {} url = '%s/Search/Book/%s/1' % (base, isbn) data = read_url(url).decode('utf-8') m = re.compile('href="(/Lookup/Book/[^"]+?)"').findall(data) if m: ids = m[0].split('/') r['isbn'] = ids[-2] r['asin'] = ids[-3] url = '%s%s' % (base, m[0]) data = read_url(url).decode('utf-8') r["title"] = find_re(data, "