bullyblinder.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:DATA 作者: hadojae 项目源码 文件源码
def obfuscation_unescape(page):
    soup = BeautifulSoup(page, "lxml")
    for scr in soup(["script"]):
        if re.search('unescape', str(scr), re.IGNORECASE):
            encoded = re.search("(?:%[0-9A-F][0-9A-F][^\"]+)", str(scr), re.IGNORECASE)
            decoded_content = urllib2.unquote(encoded.group(0))
            scr.replace_with(decoded_content)
    decoded_page = soup.decode(formatter=None)   
    tmp_file = "/tmp/tmp.html"
    with open (tmp_file, "wb") as temp_f:
        temp_f.write(decoded_page)
        temp_f.close()
    try:
        response = br.open('file://' + tmp_file)
        global using_selenium
        using_selenium = True
        return response
    except Exception:
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号