Local $doc = _MHDocGetObj()
_MHNavigate($doc, $WebTextB2)
;解析iconfor跳转后的网页,找pdf_url下载
$citation_pdf = _MHGetObjByName($doc, "citation_pdf_url")
If IsObj($citation_pdf) Then
$citation_pdf_url = $citation_pdf.content
ToolTip($citation_pdf_url)
$citation_pdf_urlAbout = StringLeft($citation_pdf_url, 6)
If $citation_pdf_urlAbout = "about:" Then
$citation_pdf_urlAboutTemp = StringTrimLeft($citation_pdf_url, 6)
$citation_pdf_url = $citation_pdf_urlAboutTemp
EndIf
$citation_pdf_urlHttp = StringLeft($citation_pdf_url, 4)
If $citation_pdf_urlHttp = "http" Then
$citation_pdf_urlFinal = $citation_pdf_url
$Filexz = $citation_pdf_urlFinal
$ok = 1
Local $file_ = FileOpen("日志记录.txt", 1);打开文件1写入 0读取
FileWriteLine($file_, @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & " " & $LRUN & " Else " & @CRLF);写入数据+换行
FileWriteLine($file_, 'http://paper.pubmed.cn/' & $id5 & @CRLF)
FileWriteLine($file_, $WebTextB2 & @CRLF);写入数据+换行
FileClose($file_)
Else
IniWrite("karger.ini", "citation_pdf_url-notreg", $id5 & "." & $PubmedID, $WebTextB2)
EndIf
Else
IniWrite("karger.ini", "Notcitation_pdf_url", $id5 & "." & $PubmedID, $WebTextB2)
EndIf
发现里面有if,不一定能让$ok = 1,这样的话,怎么自定义函数和返回值呢? |