这变量怎么不行呢
#include <IE.au3>$file1 = FileOpen(@ProgramFilesDir& "\Internet Explorer\网址.txt", 0)
$file2 = FileOpen(@ProgramFilesDir& "\Internet Explorer\关键词.txt", 0)
$file3 = FileOpen(@ProgramFilesDir& "\Internet Explorer\链接.txt", 0)
While 1
$body1 = FileReadLine($file1)
$body2 = FileReadLine($file2)
$body3= FileReadLine($file3)
Local $oLinks = _IELinkGetCollection($body3)
if @error = -1 Then ExitLoop
#include <IE.au3>
$oie = _IECreate(""&$body1&"", 1)
$oForm = _IEFormGetObjByName ($oIE, "bdfm")
$oQuery = _IEFormElementGetObjByName ($oForm, "word")
_IEFormElementSetValue ($oQuery, ""&$body3&"")
$oQuery = _IEFormSubmit ($oForm, "0")
_IELinkClickByText($oIE,'"",1)Sleep (3000)
Sleep (1000)
;ProcessExists("IEXPLORE.exe")
ProcessClose("IEXPLORE.exe")
WEnd
"&$body3&"出粗了。怎么回事呢? <IE.au3>怎么include了两次?""&$body1&""、""&$body3&""两个变量前后加空字串什么意思啊?看不明白。 回复 1# nieyiheng
这些是什么意思??你这个&和双引号是多余的.
""&$body1&"" ""&$body3&""
还有_IELinkClickByText($oIE,'"",1)Sleep (3000) 有问题,请仔细看看. 把楼主的码写个高亮......
#include <IE.au3>
$file1 = FileOpen(@ProgramFilesDir& "\Internet Explorer\网址.txt", 0)
$file2 = FileOpen(@ProgramFilesDir& "\Internet Explorer\关键词.txt", 0)
$file3 = FileOpen(@ProgramFilesDir& "\Internet Explorer\链接.txt", 0)
While 1
$body1 = FileReadLine($file1)
$body2 = FileReadLine($file2)
$body3= FileReadLine($file3)
Local $oLinks = _IELinkGetCollection($body3)
if @error = -1 Then ExitLoop
#include <IE.au3>
$oie = _IECreate(""&$body1&"", 1)
$oForm = _IEFormGetObjByName ($oIE, "bdfm")
$oQuery = _IEFormElementGetObjByName ($oForm, "word")
_IEFormElementSetValue ($oQuery, ""&$body3&"")
$oQuery = _IEFormSubmit ($oForm, "0")
_IELinkClickByText($oIE,'"",1)Sleep (3000)
Sleep (1000)
;ProcessExists("IEXPLORE.exe")
ProcessClose("IEXPLORE.exe")
WEnd
测试了下,能运行啦。但是不知道是不是楼主要的效果
小弟真不懂IE
#include <IE.au3>
$file1 = FileOpen(@ProgramFilesDir& "\Internet Explorer\网址.txt", 0)
$file2 = FileOpen(@ProgramFilesDir& "\Internet Explorer\关键词.txt", 0)
$file3 = FileOpen(@ProgramFilesDir& "\Internet Explorer\链接.txt", 0)
While 1
$body1 = FileReadLine($file1)
$body2 = FileReadLine($file2)
$body3= FileReadLine($file3)
Local $oLinks = _IELinkGetCollection($body3)
if @error = -1 Then ExitLoop
#include <IE.au3>
$oie = _IECreate(""&$body1&"", 1)
$oForm = _IEFormGetObjByName ($oIE, "bdfm")
$oQuery = _IEFormElementGetObjByName ($oForm, "word")
_IEFormElementSetValue ($oQuery, ""&$body3&"")
$oQuery = _IEFormSubmit ($oForm, "0")
_IELinkClickByText($oIE,"",1)
Sleep (3000)
Sleep (1000)
;ProcessExists("IEXPLORE.exe")
ProcessClose("IEXPLORE.exe")
WEnd 非常感谢大家的回答。尤其是魔导。我还想问: au3如何清除 ie的cookies,我关闭ie后,怎么老是有文件删不掉呢?还有就是au3怎么把txt文件逐行打乱。例如:
内容:
11
22
33
随机打乱
33
11
22 #include <IE.au3>
$file1 = FileOpen(@ProgramFilesDir& "\Internet Explorer\网址.txt", 0)
$file2 = FileOpen(@ProgramFilesDir& "\Internet Explorer\关键词.txt", 0)
$file3 = FileOpen(@ProgramFilesDir& "\Internet Explorer\链接.txt", 0)
While 1
$body1 = FileReadLine($file1)
$body2 = FileReadLine($file2)
$body3= FileReadLine($file3)
Local $oLinks = _IELinkGetCollection($body3)
if @error = -1 Then ExitLoop
#include <IE.au3>
$oie = _IECreate(""&$body1&"", 1)
$oForm = _IEFormGetObjByName ($oIE, "bdfm")
$oQuery = _IEFormElementGetObjByName ($oForm, "word")
_IEFormElementSetValue ($oQuery, ""&$body3&"")
$oQuery = _IEFormSubmit ($oForm, "0")
_IELinkClickByText($oie,"",1)
Sleep (3000)
;ProcessExists("IEXPLORE.exe")
ProcessClose("IEXPLORE.exe")
WEnd
谢谢大家明白了!
页:
[1]