Skip to content

Instantly share code, notes, and snippets.

import argparse
from lxml import html
import requests
import re
import sys
class CoinMarketCap(object):
def __init__(self, currency):
self.tree = html.fromstring(requests.get('http://coinmarketcap.com').text)
data = self.tree.xpath('//div[@id="currency-exchange-rates"]/@data-{}'.format(currency))