一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

腳本之家,腳本語言編程技術及教程分享平臺!
分類導航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服務器之家 - 腳本之家 - VBS - bookfind 通過ISBN序號獲取圖書連接的書名與作者的vbs代碼

bookfind 通過ISBN序號獲取圖書連接的書名與作者的vbs代碼

2020-08-05 10:36VBS代碼網 VBS

bookfind 通過ISBN序號獲取圖書連接的書名與作者的vbs代碼,類似小偷程序,通過正則匹配,雖然現在已經無法使用,但代碼不錯,原理都有

核心代碼:

復制代碼 代碼如下:


If WScript.Arguments.UnNamed.Count <> 1 Then Syntax
If WScript.Arguments.Named.Count > 1 Then Syntax
blnTd = False
If WScript.Arguments.Named.Count = 1 Then
If UCase( WScript.Arguments.Named( 0 ) ) = "/TD" Then
blnTd = True
Else
Syntax
End If
End If
strISBN = WScript.Arguments.UnNamed( 0 )
strPgTitle = TitleFromHTML( "http://www.amazon.com/gp/product/" & strISBN & "/" )
strPattern = "Amazon.com: (.*): Books: (.*)$"
strTitle = RegExpVal( strPattern, strPgTitle, 0 )
strAuthor = RegExpVal( strPattern, strPgTitle, 1 )
If blnTd Then
strMsg = strISBN & vbTab & strTitle & vbTab & strAuthor & vbCrLf
Else
strMsg = vbCrLf & "Title : " & strTitle _
& vbCrLf & "Author : " & strAuthor _
& vbCrLf & "ISBN : " & strISBN
End If
WScript.Echo strMsg
Function RegExpVal( strPattern, strString, idx )
On Error Resume Next
Dim regEx, Match, Matches, RetStr
Set regEx = New RegExp
regEx.Pattern = strPattern
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute( strString )
RegExpVal = Matches( 0 ).SubMatches( idx )
End Function
Function TitleFromHTML( strURL )
Set ie = CreateObject( "InternetExplorer.Application" )
ie.Navigate strURL
Do Until ie.ReadyState = 4
WScript.Sleep 10
Loop
TitleFromHTML = ie.Document.Title
ie.Quit
End Function
Sub Syntax
strMsg = strMsg & vbCrLf & "BookFind.vbs, Version 1.11" & vbCrLf _
& "Display book title and author name for the specified ISBN number." & vbCrLf & vbCrLf _
& "Usage: CSCRIPT //NOLOGO BOOKFIND.VBS isbn [ /TD ]" & vbCrLf & vbCrLf _
& "Where: ""isbn"" is the ISBN (or ASIN) of the book to search for" & vbCrLf _
& " /TD changes the output format to tab delimited" & vbCrLf & vbCrLf _
& "Note: This script uses Amazon's web site to look up author and title." & vbCrLf _
& " To be precise, the data is extracted from the title of the page" & vbCrLf _
& " with URL http://www.amazon.com/gp/product/ followed by the ISBN." & vbCrLf _
& " That means this script will fail when Amazon changes the URLs." & vbCrLf & vbCrLf _
& "Written by Rob van der Woude" & vbCrLf _
& "http://www.robvanderwoude.com"
Wscript.Echo( strMsg )
Wscript.Quit( 1 )
End Sub


使用方法:
CSCRIPT //NOLOGO BOOKFIND.VBS isbn [ /TD ]
Where: "isbn" is the ISBN (or ASIN) of the book to search for
/TD changes the output format to tab delimited
Note: This script uses Amazon's web site to look up author and title.
To be precise, the data is extracted from the title of the page
with URL http://www.amazon.com/gp/product/ followed by the ISBN.
That means this script will fail when Amazon changes the URLs.

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 亚洲精品一区二区久久这里 | 免费高清在线观看 | 国内精品一区二区三区东京 | 日本国产高清色www视频在线 | 亚洲天堂男人的天堂 | 大杳蕉在线影院在线播放 | 久久99视热频国只有精品 | 免费一级片在线观看 | 亚洲黄网站wwwwww | 日本天堂视频 | 欧美xxxxx九色视频免费观看 | 欧美又黄又激烈真实床戏 | 亚洲首页国产精品丝袜 | 不知火舞被c视频在线播放 不卡一区二区三区卡 | 男人摸女人下面 | 国产亚洲欧美成人久久片 | 国产成人精品视频频 | 亚洲丰满女人ass硕大 | 白丝校花被扒开双腿喷水小说 | 手机看片国产自拍 | 天天亚洲综合 | 精品久久免费视频 | 百合互慰吃奶互揉漫画 | 日本伦理动漫在线观看 | 五月色天在线视频综合观看 | 精品一区heyzo在线播放 | 亚洲毛片免费看 | 国产成人手机在线好好热 | 无人影院免费观看 | 91tv破解版不限次数 | 国产视频一二三区 | 天天草b | 99精品网| 色姑娘久 | 欧美日韩国产中文字幕 | 超碰av | 精品成人一区二区三区免费视频 | 精品视频 久久久 | 美女扒开腿让男人桶爽免费gif | 色老妇| 成年美女黄网色大观看全 |