用python解除html中所屏蔽的功能

 刚发过一个在地址栏的小hacker可以解除网页屏蔽,最近学习python,写了一个相当简单的玩意,也可以做此事
# -*- coding: utf-8 -*-
""" author: hujinpu """  
""" http://docs.python.org/lib/module-urllib.html """  
import  urllib 
  
urls 
=  { ' 被屏蔽功能的网页地址 ' : ' downloadtomycomputer.htm '
  
for  url  in  urls: 
    filename 
=  urls[url] 
    urllib.urlretrieve(url,filename) 
    f 
=  open(filename, ' r '
    content 
=  f.read() 
    f.close() 
    newfilename 
=   " new_ "   +  filename 
    f 
=  open(newfilename, ' w '
    f.write( content 
+   " <script>document.onselectstart = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;};</script> " ); 
    f.close()

其中urls是一个字典,可以写很多你要征服的url
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值