Jump to content

bogQ

Active Members
  • Posts

    1,944
  • Joined

  • Last visited

  • Days Won

    4

Community Answers

  1. bogQ's post in _IETableGetCollection: Does it not capture html tags (e.g. <a href="xxx">xxx</a> was marked as the answer   
    Your using _IETableWriteToArray that is using .innerText and as far as i understand from your question you need to use .innerHtml.
    So what you can do is create your own function and use similar code from original function changing that one thing if that is what you need.
     
    As for more things you can do something like this 
    #include <IE.au3> #include <Array.au3> Local $oIE = _IECreate() Local $sHTML = "<h1>test</h1>" $sHTML &= "<table>" $sHTML &= "<tr><th>Company</th><th>Contact</th><th>Country</th><th>Country</th><th>Country</th></tr>" $sHTML &= "<tr><td>Centro comercial Moctezuma</td><td>Francisco Chang</td><td>Mexico</td></tr>" $sHTML &= "<tr><td>Centro comercial Moctezuma</td><td>Francisco Chang</td><td>Mexico</td></tr>" $sHTML &= "<tr><td>Centro comercial Moctezuma</td><td>Francisco Chang</td><td>Mexico</td></tr>" $sHTML &= "<tr><td>Maria Anders</td><td>Maria Anders</td><td>XXXX</td><td>Maria Anders</td><td><a href='#'>test123</a></td></tr>" $sHTML &= "<tr><td>Maria Anders</td><td>Maria Anders</td><td>Centro comercial Moctezuma</td><td>Francisco Chang</td><td>Mexico</td></tr>" $sHTML &= "</table>" _IEBodyWriteHTML($oIE, $sHTML) $oTable = _IETableGetCollection($oIE, 0) $aTableData = _IETableWriteToArray($oTable, True) Local $row = _ArraySearch($aTableData, "XXXX", Default, Default, Default, Default, Default, Default, False) If @error Then MsgBox(0, 'error 1', @error) Local $col = _ArraySearch($aTableData, "XXXX", Default, Default, Default, Default, Default, Default, True) If @error Then MsgBox(0, 'error 2', @error) ConsoleWrite('row: ' & $row & '; col: ' & $col & " | " & $aTableData[$row][$col] & @CRLF) For $x = 0 To UBound($aTableData, 2) - 1     ConsoleWrite($aTableData[$row][$x] & @CRLF) Next _ArrayDisplay($aTableData, "Found")  
  2. bogQ's post in Hardware (CPU, MainBoard, DRIVE, RAM) manfuctured date was marked as the answer   
    I do not think that is programmatically available as information. best thing i can think of is to get bios date version from cmd with 
    wmic bios get ReleaseDate edit: on the other hand if you somehow map manifacture websites (if their url structure is usable for this) and check on their site when first bios version is published you can practically get some info around  date of creation.
    wmic baseboard get product,Manufacturer,version,serialnumber Aldo i do not have MSI mb to see what model number will upper command return, you go to  https://www.msi.com/Motherboard/B550M-PRO/support and you pull somehow last in row (first ever) bios date on that page ergo mb is from around that time.
     
  3. bogQ's post in Can't connect to MySQL server - (Moved) was marked as the answer   
    https://dev.mysql.com/downloads/file/?id=517870     32-bit driver for 32bit autoit
    or direct link https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.33-win32.msi
     
    #include "ADO.au3" #include <Array.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> _Example_ListProperties() Func _Example_ListProperties() Local $sConnectionString = _ADO_ConnectionString_MySQL('root', '', 'test', 'MySQL ODBC 8.0 ANSI Driver', 'localhost', '3306') Local $oConnection = _ADO_Connection_Create() _ADO_Connection_OpenConString($oConnection, $sConnectionString) If @error Then MsgBox(0,@error,@extended) Local $aRecordset = _ADO_Execute($oConnection, "SELECT * FROM testtable", True) If @error Then MsgBox(0,@error,@extended) _ADO_Connection_Close($oConnection) $oConnection = Null _ADO_Recordset_Display($aRecordset, 'Recordset content') If @error Then MsgBox(0,@error,@extended) EndFunc ;==>_Example_2_RecordsetDisplay
  4. bogQ's post in ControlClick not working. How to properly troubleshoot? was marked as the answer   
    (Size: w=1708, h=32) = your control is a entire toolbar and not a single button or similar control.
    in autoit window info tool go under "Options" to enable "Highlight Controls" for more help. just calling ControlClick will do click to the middle of a control, try using optional ControlClick parameters for that control regarding X,Y click position (use ControlClick Coords from window info tool), other way to try is mouseclick
  5. bogQ's post in MsgBox overrides HotKeySet was marked as the answer   
    No due that HotKeySet second parrametar expect to be a "string" with function name in it.
    MagBox dont return string but your custom funcs can return it.
    HotKeySet("{F10}", testFunc())  While 1     Sleep (1000) WEnd Func testFunc()     return "callMsgBox" EndFunc Func callMsgBox()     MsgBox (0, "It's working!", "You pressed F10") EndFunc but then why all the trouble when this is always easier
    HotKeySet("{F10}", "testFunc")  While 1     Sleep (1000) WEnd Func testFunc()     MsgBox (0, "It's working!", "You pressed F10") EndFunc  
  6. bogQ's post in Alt+~ to invoke Flip3d was marked as the answer   
    well you can try {tab down} but i dont know will it work
     
    as for your first problem [the one thing missing is that it exits the function if i lift the "`" key while still holding "ALT" down.]
    think this should solve it

    #include <Misc.au3> HotKeySet('!{`}', '_flip3d') While 1 Sleep(100) WEnd Func _flip3d() Send('{LWINDOWN}') Do Local $ftime = False Do Send('{TAB}') If $ftime = False Then $ftime = True Sleep(400) EndIf Sleep(150) Until Not _IsPressed('C0') Or Not _IsPressed('12') If Not _IsPressed('C0') And Not _IsPressed('12') ExitLoop 1 Do Sleep(150) Until Not _IsPressed('12') Or _IsPressed('C0') Until Not _IsPressed('C0') And Not _IsPressed('12') Send('{LWINUP}') EndFunc ;==>_flip3d
  7. bogQ's post in HotKeySet issues was marked as the answer   
    its
    HotKeySet("^!u", "_Login") ;CTRL + ALT + U not HotKeySet("^!u", _Login()) ;CTRL + ALT + U   for second question   Failure: $IDTIMEOUT (-1) if the message box timed out. so it shud return -1 if timeouted
    so "If $MsBox = -1 Then MsgBox(16,'','something something something dark side')" should work 
  8. bogQ's post in gui not responsive while in SLEEP was marked as the answer   
    you declared loop in a loop so you are traped inside it

    one of the many wayes to do what you need can be like this
     

    #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Local $hGUI = GUICreate("Example", 400, 100) Local $GUI_Button_Exit = GUICtrlCreateButton("Exit", 10, 10, 85, 25) Local $GUI_Button_Test = GUICtrlCreateButton("test", 120, 10, 85, 25) GUISetState() $isITclicked = False $FirstLoop = False Local $hTimer, $max = 18;wait this many seconds While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_Button_Exit Exit 0 Case $GUI_Button_Test ;~ If Not $isITclicked And Not $FirstLoop Then;enable to dont restart counting seconds if it already started $isITclicked = True $FirstLoop = True ;~ EndIf EndSwitch If $isITclicked Then If $FirstLoop Then $FirstLoop = False $hTimer = TimerInit() ; Begin the timer EndIf Local $fDiff = TimerDiff($hTimer) / 1000 ; transform into sec If $fDiff >= $max Then MsgBox($MB_SYSTEMMODAL, "Time Difference", $fDiff) $isITclicked = False ToolTip('') Else ToolTip($fDiff) EndIf EndIf WEnd there is ofc AdlibRegister func that can do similar things you need
  9. bogQ's post in Right click systray -> action without menu showing was marked as the answer   
    insert this after your Opt("TrayMenuMode", 1)

    TraySetClick(1);1 = Pressing primary mouse button
  10. bogQ's post in Can anyone help me format this line "'"'"'"'"" was marked as the answer   
    your @SW_HIDE parametar isn`t on correct place, look in the help file for where to place @SW_HIDE parametar on ShellExecuteWait command
  11. bogQ's post in autoit javascript error was marked as the answer   
    $oElem = $oIE.document.GetElementsByTagName("p").item(1).innerText()
  12. bogQ's post in trying to click a button not working (2 different issues) was marked as the answer   
    put
    WinWaitActive after WinActivate and some sleep 1 second or something

    try ControlFocus and check do correct control got the focus with ControlGetFocus if that part worked do a ControlSend {space} instead of ControlClick, if it did not worked tell us what ControlGetFocus returned
  13. bogQ's post in TCP communication with non Autoit apps ? was marked as the answer   
    TCP (Transmission Control Protocol) shud be TCP regardless of what program you use on other end. one app to comunicate with another shud not have any problems if you know how to send with one language and how to recive with another.
  14. bogQ's post in Button place on a picture does not work was marked as the answer   
    create picture disable it and then create your button

    #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <GUIListView.au3> #include <ButtonConstants.au3> #include <GuiTab.au3> $MainWindow = GUICreate("Installation d'imprimante / Printer install", 1000, 850, 20, 20, $WS_BORDER) $MainTab = GUICtrlCreateTab(25, 25, 950, 730) $CloseBtn = GUICtrlCreateButton("Close", 460, 775, 80, 30) $FloorTab = GUICtrlCreateTabItem("Plancher / Floor") $FloorPic = GUICtrlCreatePic(@MyDocumentsDir & "\AutoIT\Install Printers\Floor.bmp",50,50,900,700) $OfficeTab = GUICtrlCreateTabItem("Bureau / Office") $OfficePic = GUICtrlCreatePic(@MyDocumentsDir & "\AutoIT\Install Printers\Office.bmp",50,50,900,700) GUICtrlSetState($OfficePic, $GUI_DISABLE);disable picture $T1108467Btn = GUICtrlCreateButton("T1108467", 550, 180, 80, 30);create button after picture ;GUICtrlSetState($T1108467Btn,$GUI_ONTOP) --> this line does not work GUISetState(@SW_SHOW) Local $msg While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $T1108467Btn ExitLoop Case $msg = $CloseBtn ExitLoop EndSelect WEnd GUIDelete()
  15. bogQ's post in ie bug finder ? cant remember the prog name was marked as the answer   
    http://www.debugbar.com/ ?
  16. bogQ's post in how to find element or object by link was marked as the answer   
    look at scite console output and you will see that you already have code for that in script
    MsgBox(0, "number followers", _StringBetween($oInput.innerHTML(),'>','<')[0])
  17. bogQ's post in _IELoadWait Timeout Does not Work With _IEAction was marked as the answer   
    well wait for it to b ready. trying to do clicks and checks while page isnt ready will not help.

    if you have Invalid Data Type error try to set $i_delay to lets say 500ms and $i_timeout to something reasnoble like 5 seconds, if needed put 2 times _IELoadWait if page reload it self after first load.
    if and after second _IELoadWait and first _IELoadWait fail, redirect it to knwon starting url to try one more time.

    After correct page loading check if you have your button still there, use _IEFormElementGetObjByName (or similar command that your using) and check if it returned any error. If page is loaded correctly and button returns error your problem is solwed, you will know that your button is or not there.

    all i see from your code is trying to click something that might or maynot be there depending only on errors where you expect specific error that mignt not b there coz of the main question, is even your clickable object is there.

    If you dont want your code to be posted publicly but the site is publicly available you can pm me with original code to try to find some workaround, the way you're doing it now, i just dont see your original code working in my mind at the curent state that its in.
  18. bogQ's post in Does _INetGetSource or _IEDocReadHTML work with secure sites was marked as the answer   
    that will produce some large msgbox on win7

    code returned from page can be diffrent on diffrent ie versions so try it like this and youl see that you will get your msgbox (there are faster wayes to strip that chars if needed but for fun they are in loop)
     
    $oIE = _IECreate("https://www.java.com/en/download/manual.jsp") $sString = _IEBodyReadHTML($oIE) Do $sString = StringReplace($sString,' ','') Until @extended = 0 Do $sString = StringReplace($sString,@LF&@LF,@LF) Until @extended = 0 MsgBox(0,'',$sString) ConsoleWrite($sString) anyway ConsoleWrite can still display the source with no replaces, so its probably some msgbox limit or something...
  19. bogQ's post in Bring a web element to focus was marked as the answer   
    no problems here
    #include <IE.au3> $IEhWnd = WinGetHandle("Test HTML","") $oIE = _IEAttach($IEhWnd,"HWND") $oForm = _IEFormGetObjByName($oIE, "testform")  _IEFormElementRadioSelect($oForm, "thisone", "myradios");note the diffrance from your code :P
  20. bogQ's post in Do I have a bug in my code? was marked as the answer   
    "number 1920 is the same as 2091"gota agree with czards on thisone aldo he do have If $Max_avArray1 <> $Max_avArray2 Then
    so case is first array contain
    [1] = 111
    [2] = bbb
    [3] = bbb
    and other contain
    [1] = 111
    [2] = 111
    [3] = bbb
    are they equal or not using arraysearch?

    so gil900 i think your logic have problems with search and with speed
    something similar to this shud work if abowe is needed, so to use comparing instead search and adding unique if needed before sorting is your choice
     

    Func _IfArrayEqual($avArray1, $avArray2, $ArrayType = 1) $output = -1 $Max_avArray1 = UBound($avArray1) - 1 $Max_avArray2 = UBound($avArray2) - 1 If $Max_avArray1 <> $Max_avArray2 Then Return '+>NOT OK one is larger than another!!!' Else _ArraySort($avArray1) _ArraySort($avArray2) If $ArrayType = 1 Then For $a = 0 To $Max_avArray1 If $avArray1[$a] <> $avArray2[$a] Then Return '->NOT OK, data problem ("'&$avArray1[$a]&'") vs ("'&$avArray2[$a]&'") line '&$a Next Else For $a = 0 To $Max_avArray1 ;some code for everything else Next EndIf EndIf Return '!>Everything is OK' EndFunc
  21. bogQ's post in IE click google div (button) was marked as the answer   
    it do apply, only problem is (i think) that google refuse to take action.
    if you dont finde beter solution this messy code can probably help you in same way
     

    #include <IE.au3> $winname = 'My Drive' $buffer = _IEAttach($winname) $colLinks = _IETagNameGetCollection($buffer, 'div') For $oLink In $colLinks If $oLink.className() = "goog-inline-block jfk-button jfk-button-primary goog-toolbar-item-new" Then $x = _IEPropertyGet($oLink, 'screenx') $y = _IEPropertyGet($oLink, 'screeny') If $x > -1 And $y > -1 Then $pos = ControlGetPos($winname, '', '[CLASS:Internet Explorer_Server; INSTANCE:1]') $pos_win = WinGetPos($winname) ControlClick($winname, '', '[CLASS:Internet Explorer_Server; INSTANCE:1]', 'left', 1, $x - ($pos_win[0] + $pos[0]), $y - ($pos_win[1] + $pos[1])) Else MsgBox(0,'Win need not to b minimized for this to work','') EndIf EndIf Next
  22. bogQ's post in INetGet not applying filters in google search was marked as the answer   
    winhttp.winhttprequest.5.1 whud not work on google so i guess this can
     

    $data = 'https://www.google.com/search?q=HSBC&safe=off&hl=en&gl=uk&biw=1920&bih=979&sa=X&ei=jKG8UYLfGYKqOrbIgOgJ&ved=0CCAQpwUoBg&source=lnt&tbs=cdr%3A1%2Ccd_min%3A15%2F06%2F2013%2Ccd_max%3A16%2F06%2F2013&tbm=nws' $XML = ObjCreate("Microsoft.XMLHTTP") $XML.Open("GET", $data, 0) $XML.Send() $sSource = $XML.Responsetext() ConsoleWrite($sSource)whud not advise you to save as an html file and open it with browser to see end results, after save try with some html editor like frontpage if you have it or something better...
×
×
  • Create New...