A大剑指源头……………………
提供一种模拟移动鼠标到LI上面,激活后读源码:(这种网页直接_IELinkClickByText没效果???)
模拟移动有局限性,目前测试是可以读取到内容——————坐等更稳妥的解答————[password]#include <Array.au3>
#include <IE.au3>
$oIE = _IEAttach("https://lol.qq.com/news/index.shtml", "url")
$hIe=_IEPropertyGet($oIE,"hwnd")
WinActivate($hIe)
Local $oLIs = _IETagNameGetCollection($oIE, "LI")
For $oLI In $oLIs
If $oLI.innertext = '公告 ' Then
$oIE.document.documentElement.scrollTop= 0 ;防止定位不准确,先滚动到top,模拟点击局限性…不能后台获取…故前面需要WinActivate
; 获取文本区域的坐标和尺寸
Local $iScreenX = _IEPropertyGet($oLI, "screenx")
Local $iScreenY = _IEPropertyGet($oLI, "screeny")
Local $iWidth = _IEPropertyGet($oLI, "width")
Local $iHeight = _IEPropertyGet($oLI, "height")
; 移动鼠标到区域中心停止移动
Local $iMousespeed = 1
MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed)
ExitLoop
EndIf
Next
$sSource = _IEDocReadHTML($oIE)
Local $aSRE = StringRegExp($sSource, "'newdList-inform\d+','(.*?)'\);", 3)
_ArrayDisplay($aSRE, 'Debug~~~')
[/password]
|