def get_qrcode_full_url():
    #TODO handle connection problem etc.
    # we first open the html page of the webclient
    # that contain the QRcode image
    response = urllib2.urlopen(WEIXIN_QRCODE_PAGE)
    html = response.read()
    
    # we search the img tag ...
    tree = etree.HTML(html)
    for image in tree.xpath("//img"):
        if image.attrib.has_key('class'):
            # ... that contain the QRcode class...
            if image.attrib['class'] in QRCODE_TAG_CLASSES:
                imageUrl = image.attrib['src']
                # ... and we return the full url of it
                qrcodeFullUrl = WEIXIN_LOGIN_DOMAIN + imageUrl
                return qrcodeFullUrl


# return a raw binary string of the image
dataset/ETHPy150Open allan-simon/py-weixin-client/qrcode.py/get_qrcode_full_url/swapped operands of `in`