本帖最后由 wo2china 于 2018-10-22 14:41 编辑 ;插入JQuery
Func _InsertJQuery($oIE)
Local $sScript_jQuery = FileRead(@ScriptDir & '\jquery-3.3.1.min.js')
Local $oHead = _IETagNameGetCollection($oIE, "head", 0)
$objScript = $oIE.document.createElement('script')
$objScript.type = 'text/javascript'
$objScript.language = 'javascript'
$objScript.text = $sScript_jQuery
$oHead.appendChild($objScript)
$oIE.Document.parentWindow.execScript("document.body.jQuery = jQuery;")
$oIE.Document.parentWindow.execScript("document.body.eval = eval;")
$ojQuery = $oIE.Document.body.jQuery
$oEval = $oIE.Document.body.eval
While Not (IsObj($ojQuery))
Sleep(100)
WEnd
$ojQuery.noConflict()
Return $ojQuery
EndFunc ;==>_InsertJQuery
$oIE = _IEAttach("", "instance", 1)
$jq = _InsertJQuery($oIE)
msgbox(0, "", $jq('div.shoppingCart-package em[name="actionCd"]').text())
|