import htmlparser import xmltree # To use '$' for XmlNode import strtabs # To access XmlAttributes import os # To use splitFile import strutils # To use cmpIgnoreCase import httpclient import streams proc getBashQuote(html: string): string = let html = parseHtml(newStringStream(html)) for elem in html.findAll("div"): if elem.attr("class") == "text": echo "test a" echo elem let text = elem.innerText if not text.isNil: return text let client = newHttpClient() let data = client.get("http://bash.im/quote/444074") echo getBashQuote(data.body)