那是编码转换的问题
#include "Ie.au3"
MsgBox(64, "", xinhuanetNews("http://news.xinhuanet.com/world/2008-10/08/content_10164358.htm",200))
Func xinhuanetNews($url, $Count)
If $url <> "" Then
$html = _IECreate($url, 0, 0, 1, 0)
$html = _IEDocReadHTML($html)
$StartStr = "<FONT color=#0000ff>"
$EndStr = "(编辑"
$Start = StringInStr($html, $StartStr)
$End = StringInStr($html, $EndStr)
$html = StringMid($html, $Start, $End - $Start)
$html = StringRegExpReplace($html, "<.*?>", "")
;~ $html = StringRegExpReplace($html, "\s", "")
$html = StringReplace($html, " ", "")
If StringLen($html) < 10 Then
Return ("False!")
Else
Return (StringLeft($html, $Count)&"……")
EndIf
Else
Return ("False!")
EndIf
EndFunc ;==>xinhuanetNews
|