成语大全网 - 汉语词典 - Qtranslate怎么添加词典

Qtranslate怎么添加词典

参考一下

/view/aba98f8f84868762caaed5dd?fr=prin

or

Function worddef(str1 As String)

'/search?q=单词&keyfrom=dict.index

Dim XH As Object

Dim s() As String

Dim str_tmp As String

Dim str_base As String

'开启网页

Set XH = CreateObject("Microsoft.XMLHTTP")

On Error Resume Next

XH.Open "get", "/search?q=" & str1 & "&keyfrom=dict.index", False

XH.send

On Error Resume Next

str_base = XH.responseText

XH.Close

Set XH = Nothing

str_base = Split(Split(XH.responseText, "<div id=""webTrans"" class=""trans-wrapper trans-tab"">")(0), "<span class=""keyword"">")(1)

worddef = ""

'撷取中文翻译

str_tmp = Split((Split(str_base, "<div class=""trans-container"">")(1)), "</div>")(0)

str_tmp = Split((Split(str_tmp, "<ul>")(1)), "</ul>")(0)

s = Split(str_tmp, "<li>")

worddef = Split(s(LBound(s) + 1), "</li")(0)

For i = LBound(s) + 2 To UBound(s)

worddef= worddef & Chr(10) & Split(s(i), "</li")(0)

Next

End Function