3 posts in this topic
I want creat GUI, have button 1 to 10, but only use loop for ... to ... step ... next.
i have two files a.au3 and b.au3 the both contains the same code which is :
#include <IE.au3> #include <MsgBoxConstants.au3> Global $myUrl = "https://www.autoitscript.com" RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main','SessionMerging','REG_DWORD','00000000') ShellExecute ("iexplore.exe", " -nosessionmerging about:blank") WinWait ("Blank Page") Global $oIE = _IEAttach ("about:blank", "url") _IELoadWait ($oIE) _IENavigate ($oIE, $myUrl) when i launch the both files in the same time two blank windows are opens.
what im waiting for is that every window navigate to the link but what happen is the first and the second file navigate the url to the same window and the seconde window stay about:blank
i think the problem happen because i try to open the same url in both windows
so i need i way to navigate to the same url from two different windows
Thanks in advance
I have a page with several hundred <div>s, and each <div> has several hundred child <div>s, each with their own children
when I use _IETagNameGetCollection($ie, "div", 0) I get them all, but I need to find a way to get say the 3rd child of the 5th child of the second top level <div>
I have not yet been able to find anything along this line
Is there any way to determine if an element is a child, parent, sibling?
Does anyone have any idea why Test() returns 0, while Test2() returns 1?
#include <IE.au3> MsgBox(0, "", Test() & " " & Test2()) Func Test() Local $oHTML = ObjCreate("HTMLFILE") $oHTML.body.innerHTML = FileRead("Test.html") Return IsObj($oHTML.getElementsByClassName("example")) EndFunc Func Test2() Local $oIE = _IEAttach("", "instance", 1) Return IsObj($oIE.document.getElementsByClassName("example")) EndFunc Sample Test.html I open in IE before testing:
<!DOCTYPE html> <html> <body> <p class="example"></p> <div class="example"></div> </body> </html> I'm receiving html text in a response to http request, I need to parse it fast and easy, getElementsByClassName would have been ideal. I'm using 188.8.131.52 version.
I want the number in a file to be overwritten with the next number up each time a button is pressed.
So it is pressed once, the number '1' is written to the file. It is pressed again and the number '2' overwrites the first number.
At the moment I get the number 1 written, but can't get it to overwrite. What I have so far:
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #Region ### START Koda GUI section ### Form=C:\Users\soulf\Desktop\CalcGui\RLCalc.kxf $Form1 = GUICreate("Form1", 615, 437, 426, 141) $One = GUICtrlCreateButton("1", 32, 72, 25, 25) GUICtrlSetBkColor(-1, 0xFF0000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func First () $fPath = "C:\temp\First.txt" $fOpen = FileOpen ($fPath, 2) $Counter = FileReadLine ($fpath) $counter = $counter + 1 $fWrite = filewriteline ($fPath, $counter) FileClose ($fpath) EndFunc While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $One Call ("First") EndSwitch WEnd I tried a Do Until statement, but that just puts the numbers 1 to 5 in the file.
Any help would be greatly appreciated!