def getWeb(url, isFeed):
    """Download url and parse it with lxml.
    If "isFeed" is True returns lxml.etree
    else, returns lxml.html
    """
    socket.setdefaulttimeout(300)
    loadedWeb = urllib2.build_opener()
    loadedWeb.addheaders = getHeaders()
    if isFeed:
        web = etree.parse(loadedWeb.open(url))
    else:
        web = html.parse(loadedWeb.open(url))
    return web
def getWeb ( url , isFeed ) : socket . setdefaulttimeout ( 300 ) loadedWeb = urllib2 . build_opener ( ) loadedWeb . addheaders = getHeaders ( ) if isFeed : web = etree . parse ( loadedWeb . open ( url ) ) else : web = html . parse ( loadedWeb . open ( url ) ) return web
Download url and parse it with lxml.
    If "isFeed" is True returns lxml.etree
    else, returns lxml.html