Skip to content

Instantly share code, notes, and snippets.

from lxml import html
import requests
import re
import sys
class CoinMarketCap(object):
def __init__(self):
self.tree = html.fromstring(requests.get('http://coinmarketcap.com').text)
self.euro_dollar = float(self.tree.xpath('//div[@id="currency-exchange-rates"]/@data-eur')[0])
from lxml import html
import requests
import re
import sys
from optparse import OptionParser
class CoinMarketCap(object):
def __init__(self):
self.tree = html.fromstring(requests.get('http://coinmarketcap.com').text)
self.euro_dollar = float(self.tree.xpath('//div[@id="currency-exchange-rates"]/@data-eur')[0])