破解网页不能保存该页/不能被另存为';,偶给你支一招
一些网页,制作者为了保护自己的版权,加了不少的限制,譬如说,限制选择,不能复制,屏蔽了鼠标右键,等非常之多,这些做法通常是用javascript的脚本程序来实现的。
有一个防止“另存为”的方法是在网页中加上:
< noscript>< iframe src=*.html>< /iframe>< /noscript>
当然还右别的类似的方法。我在网上经常发现,对于javascript的限制,右一些破解的办法。偶(郭庆平)不才,给大家出一招,来破解 此法。
先准备两个程序如下:
‘///////////////////////////////////////////////////////////
1、输入url目标网页地址,返回值getHTTPPage是目标网页的html代码
function getHTTPPage(url)
dim Http
set Http=server.createobject(MSXML2.XMLHTTP)
Http.open GET,url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,GB2312)
set http=nothing
if err.number<>0 then err.Clear
end function
’2、转换乱玛,直接用xmlhttp调用有中文字符的网页得到的将是乱玛,可以
通过adodb.stream组件进行转换
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject(adodb.stream)
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
’==================================================================
上比 两个程序不用选改,可直接使用,用于抓取源代码。抓取源代码如下:
Dim Url,Html
Url=http://www.name623.com/article.asp
Html = getHTTPPage(Url)
变量html 就是获取了网页源代码,直接输出就是网页页面了,
在此需要把限制取掉
具体是;http://www.name623.com/article.asp
:em02: