Skip to content

Instantly share code, notes, and snippets.

Created December 6, 2014 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6c4a833c2722a5c1657e to your computer and use it in GitHub Desktop.
Save anonymous/6c4a833c2722a5c1657e to your computer and use it in GitHub Desktop.
>>> table = {}
>>> for v in html.xpath('//td[@class="bottlinglabel"]/following-sibling::td'):
... table[v.getprevious().text] = v.text
...
>>> table
{'Johannes van den Heuvel': '67 ', 'Bottling Name': 'Non-Chillfiltered', 'Bottler': ' Official Bottling', 'Brand Name': 'Arran', 'Alcohol By Volume': '46%', 'Issued': None, 'Davin de Kergommeaux': '71 ', 'Distillery': 'Arran', 'Ho-cheng Yao': '63 ', 'Lawrence Graham': '72 ', 'Bert Bruyneel': '76 ', 'Luc Timmermans': '66 ', 'Serge Valentin': '65 ', 'Krishna Nukala': '80 ', None: 'No tasting notes listed yet for this bottling.', 'Average Score': '71', 'Olivier Humbrecht': '82 ', 'Type': 'Scotch Single Malts (Disclosed Distilleries)'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment