千家信息网

如何使用vbs实现bookfind通过ISBN序号获取图书连接的书名与作者

发表于:2026-10-31 作者:千家信息网编辑
千家信息网最后更新 2026年10月31日,这篇文章主要为大家展示了"如何使用vbs实现bookfind通过ISBN序号获取图书连接的书名与作者",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"如何使用
千家信息网最后更新 2026年10月31日如何使用vbs实现bookfind通过ISBN序号获取图书连接的书名与作者

这篇文章主要为大家展示了"如何使用vbs实现bookfind通过ISBN序号获取图书连接的书名与作者",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"如何使用vbs实现bookfind通过ISBN序号获取图书连接的书名与作者"这篇文章吧。

核心代码:

复制代码 代码如下:


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.

以上是"如何使用vbs实现bookfind通过ISBN序号获取图书连接的书名与作者"这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!

书名 作者 图书 序号 代码 内容 篇文章 学习 帮助 使用方法 方法 易懂 更多 条理 核心 知识 编带 行业 资讯 资讯频道 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 上海睿民互联网科技有限公司 鸠鸠互联网科技 互联网医疗科技 甘肃拓世互联网科技有限公司 佩信高科技互联网 互联网和高科技公司 宁波青枫互联网科技有限公司 互联网科技教育视频 智腾互联网科技有限公司 互联网科技扶贫时间 想开互联网科技公司怎么样 洛阳共同富裕互联网科技有限公司 科技赋能视角下互联网保险发展 每天都有哪些好的互联网科技 富国互联网金融科技混合基金 上海创道互联网络科技有限公司 互联网科技年终奖 悟空问答互联网科技 山东蛋芒互联网科技有限公司 现代互联网科技公司 互联网科技公司电话 互联网科技的英文 凡科互联网科技 丰台科技园 互联网公司 互联网 科技馆 开启互联网科技时代小说 珠海东科互联网科技有限公司 普陀区互联网教育科技管理办法 中国互联网公司的科技投入 玉溪新华互联网科技怎么选
0