Jump to content

michaelslamet

Active Members
  • Posts

    889
  • Joined

  • Last visited

  • Days Won

    1

michaelslamet last won the day on January 14 2014

michaelslamet had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

michaelslamet's Achievements

  1. I have 2 exe file (autoit's compiled script) running. Both are using FF.AU3. When 1 of the script execute _FFQuit() command, why does it close both firefox browser? Shouldn't it only close it's own firefox and left the other firefox untouchable? Thanks!
  2. Thanks a lot Danp2, for trying to help This is the output of the Scite: _FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3 _FFConnect: AutoIt: 3.3.8.1 _FFConnect: FF.au3: 0.6.0.1b-15 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 1276 _FFConnect: Browser: Mozilla/5.0 (Windows NT 5.1; rv:43.0) Gecko/20100101 Firefox/43.0 __FFSendJavaScripts: Sending functions to FireFox .......... done _FFLoadWait: ... loaded in 543ms [object HTMLDocument] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...} _FFLoadWait: . loaded in 11ms [object HTMLDocument] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...} __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate("//*[@data-target='#LoginAgentModal']",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: http://www.rumah123.com/modals/login - {toString: function() {...}, target: "", download: "", ping: "", rel: "nofollow", relList: {...}, hreflang: "", ...} __FFSend: try{FFau3.simulateEvent(FFau3.xpath,'KeyboardEvent','keypress',13);}catch(e){'_FFCmd_Err';}; __FFRecv: 1 __FFSend: FFau3.WCD=window.content.top.document; __FFRecv: [object HTMLDocument] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...} [object HTMLDocument] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...} __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate("//input[@id='username']",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: __FFSend: try{FFau3.xpath.value='me@me.com'}catch(e){'_FFCmd_Err';}; __FFRecv: _FFCmd_Err _FFLoadWait: . loaded in 11ms [object HTMLDocument] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...} +>12:56:22 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 12.776 Tried with FF.au3 version 10 and 15, both dont work in this case. Currently I'm using _WinAPI_Keybd_Event to simulate the TAB key. Works much better than SEND, but not 100% success. If it possible, I prefer using FF.AU3 function to do this task. This the _WinAPI_Keybd_Event code that working much better than SEND: BlockInput(1) Sleep(250) WinActivate("[CLASS:MozillaWindowClass]", "") ; press TAB 5 times For $a = 1 to 5 _WinAPI_Keybd_Event ( 0x09, $KEYEVENTF_EXTENDEDKEY) _WinAPI_Keybd_Event ( 0x09, $KEYEVENTF_KEYUP) Sleep(200) Next Send($Username[1]) _WinAPI_Keybd_Event ( 0x09, $KEYEVENTF_EXTENDEDKEY) _WinAPI_Keybd_Event ( 0x09, $KEYEVENTF_KEYUP) Sleep(200) Send($Password[1]) ; press TAB 2 times _WinAPI_Keybd_Event ( 0x09, $KEYEVENTF_EXTENDEDKEY) _WinAPI_Keybd_Event ( 0x09, $KEYEVENTF_KEYUP) Sleep(200) _WinAPI_Keybd_Event ( 0x09, $KEYEVENTF_EXTENDEDKEY) _WinAPI_Keybd_Event ( 0x09, $KEYEVENTF_KEYUP) Sleep(200) ; press SPACE to login _WinAPI_Keybd_Event ( 0x20, $KEYEVENTF_EXTENDEDKEY) _WinAPI_Keybd_Event ( 0x20, $KEYEVENTF_KEYUP) Sleep(200) BlockInput(0) Wonder why it works on your side but not on mine?
  3. I'm trying to automate login on this site in the last few days, and I have to admit it drive me crazy. Seems like there is no solution. The site is rumah123 dot com Click on the "Login atau Daftar" link at top right screen. (I am using this code that work beautifully to click on that link): $oInput = _FFXPath('//*[@data-target="#LoginAgentModal"]') Sleep(250) _FFDispatchEvent($oInput, 'keypress', 13) A login form will displayed. The problem no matter what code I tried, it can not fill the "username" and "password" part. Tried these without success: _FFXPath('//input[@id="username"]') _FFCmd("FFau3.xpath.value='me@me.com'") _FFSetValue("me@me.com", "username", "id") _FFSetValue("$me@me.com", "username", "name") Tried also with SEND command, but the SEND command is very not reliable: sometime it works, sometime not: BlockInput(1) Sleep(500) WinActivate("[CLASS:MozillaWindowClass]", "") Sleep(50) For $a = 1 to 5 Sleep(50) Send("{TAB}") Next Sleep(50) Send($Username[1]) Sleep(50) Send("{TAB}") Sleep(50) Send($Password[1]) Sleep(50) Send("{TAB}") Sleep(50) Send("{SPACE}") BlockInput(0) Is there is any way to automate this kind of form/site using FF.AU3 ? Thanks a lot!
  4. Thanks a lot, Danp2 I guess that will work, but finally I got it work perfectly using this code before tried _FFCmd above: $oInput = _FFXPath('//*[@id="superbutton"]') Sleep(500) _FFDispatchEvent($oInput, 'keypress', 13) Hope it help everyone who face a similiar problem. Thanks, again!
  5. I'm trying to simulate a click on a button using FireFox (FF.AU3), but no success in these last few days This is the source code of the page: <a href="#" class="btn btn-sm btn-green" id='superbutton' onclick="kickme(event,'ids11')" > <span class="icon"><i class="super-icon"></i></span> <span id='superbutton'>&nbsp; ClickMe</span> </a>Tried with no success: _FFClick("superbutton", "id")_FFClick("btn btn-sm btn-green", "class", 0)That "0" index also already replaced by other numbers (in order to do a try and error approach). The _FFLinkClick result below looks promising: _FFLinkClick("ClickMe", "text")__FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate("//a[contains(.,'ClickMe')]",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: http://thisistheweb.com/thepage# - {toString: function() {...}, target: "", download: "", ping: "", rel: "", relList: {...}, hreflang: "", ...} __FFSend: try{FFau3.simulateEvent(FFau3.xpath,'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: 1 Seems it found the button and click it, but in fact: it doesn't. Or maybe it did click it, but the result is totally different with if I click the button manually. So... I'm thinking if I cant simulate a click on the button, I should execute the JavaScript onclick event. But... how? Thanks a lot
  6. Ok, I'm going to do some experiment with it. Thanks, KaFu
  7. aha! understand now So could I say if it is detected as "unknown", it's quite a big chance it's a text file? Not 100% for sure, but pretty big chance?
  8. Thank you again, KaFu. You're correct Now it's working to .jpg and .exe files, but when it come to text file (.txt, .au3) why it always return "Unknown filetype!" ? Test and see yourself
  9. Looks promising, especially this library also used in SMF! thanks! Unfortunetely, no matter what file I put to analyzed, it always display: "Unknown filetype!" ; TrIDlib AutoIt Demo ; http://mark0.net/code-tridlib-e.html #include "TrIDLib-const.au3" $MyFile = "c:\temp\11.jpg" ; a random file to analyze $Buf = "" ; allocate a string for the results $Dll = DllOpen("TrIDLib.DLL") ; Open TrIDLib DLL $Ret = DllCall($Dll, "int", "TrID_LoadDefsPack", "str", "") ; load the definitions $Ret = DllCall($Dll, "int", "TrID_SubmitFileA", "str", $MyFile) ; submit the file $Ret = DllCall($Dll, "int", "TrID_Analyze") ; perform the analysis if @error = 1 then MsgBox(48, "TrID_Analyze", "Error(s) occurred!") Else $Ret = DllCall($Dll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_NUM, "int", 0, "str", $Buf) $ResNum = $Ret[0] ; get the results number $Out = "" if $ResNum = 0 Then $Out = "Unknown filetype!" Else For $ResId = 1 to $ResNUm ; cycle trough results $Ret = DllCall($Dll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_FILETYPE, "int", $ResId, "str", $Buf) $Out = $Out & $ResId & ":" & Chr(9) & $Ret[3] ; get the filetype description $Ret = DllCall($Dll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_FILEEXT, "int", $ResId, "str", $Buf) $Out = $Out & " (" & $Ret[3] & ")" ; get the filetype extension $Ret = DllCall($Dll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_POINTS, "int", $ResId, "str", $Buf) $Out = $Out & " - " & $Ret[0] ; get the matching points $Out = $Out & Chr(13) Next EndIf MsgBox(0, "TrIDLib demo", $Out) EndIf DllClose($Dll) ; cleanup WinXP, AutoIT 3.8.8.1 What did I do wrong?
  10. @boththose, @Melba, @mikell: wonderful, works as expected! I'm going to make slight modification since I found some other patterns as well. Thank you so much
  11. How to check if a file is a text file or a binary file without see the file extension? Binary example: doc, swf, exe, zip, rar, jpg, png, gif Text example: txt, xml, ini, inf, log Thanks
  12. $str = '08121901000 - 022 99621221 - www.adv08.com</div><!--description-->' & @CRLF & _ 'call: 08 55555 6111 (Dadan)</div><!--description-->' & @CRLF & _ '<img src="/getattachment/9630832c-3d4e-4e5b-af83-ee8bb6e9dbad/Show.aspx?maxSideSize=60" alt="Bemper Mitsubishi Pajero 2002"/></div><!--slide-thumbnail-->' & @CRLF & _ '<a href="/Asesoris-car/Aksesoris-other/Bemper-Mitsubishi-Pajero-2002-512066" target="_blank">Bemper Mitsubishi Pajero 2002</a><br />Bemper Mitsubishi Pajero 2002 4x4. Import from Australia, brand new, eks stock, call Raymond 0812711451</div><!--description-->' & @CRLF & _ 'Joe: 0878 6131 7111' & @CRLF & _ 'Text Me : 0822 8124 8624' & @CRLF & _ '081251136118(james)' & @CRLF & _ '7123408,081288778899' & @CRLF & _ '022 99621221,08121901012 - www.adv808.com</div><!--description-->' & @CRLF & _ '99621081,08111901112 - www.adv808.com</div><!--description-->' & @CRLF & _ 'For more info, please call 081233666201 / 081731161201' & @CRLF & _ 'For more info, please call 081233666201' & @CRLF & _ '<div class="titl listtitl"><a href="/car/acce-Others/VIMAX-PILL-ORIGINAL-(4)">VIMAX PILL ORIGINAL PERMANENT (081126747616)</a></div>' & @CRLF & _ 'there is nothing to grab here 08klajsa212222' & @CRLF & _ 'there is no valid pattern to grab here because length is 9 081123456' & @CRLF I would like to get number that start with "08" and length between 10~12, eg: 08121901000 from "08121901000 - 022 99621221 - www.adv08.com</div><!--description-->" 08555556111 from "call: 08 55555 6111 (Dadan)</div><!--description-->" 0812711451 from "<a href="/Asesoris-car/Aksesoris-other/Bemper-Mitsubishi-Pajero-2002-512066" target="_blank">Bemper Mitsubishi Pajero 2002</a><br />Bemper Mitsubishi Pajero 2002 4x4. Import from Australia, brand new, eks stock, call Raymond 0812711451</div><!--description-->" 087861317111 from "Joe: 0878 6131 7111" & @CRLF 082281248624 from "Text Me : 0822 8124 8624" & @CRLF 081251136118 from "081251136118(james)" & @CRLF 081288778899 from "7123408,081288778899" & @CRLF 08121901012 from "022 99621221,08121901012 - www.adv808.com</div><!--description-->" & @CRLF 081233666201 and 081731161201 from "For more info, please call 081233666201 / 081731161201" & @CRLF 081233666201 from "For more info, please call 081233666201" & @CRLF 081126747616 from "<div class="titl listtitl"><a href="/car/acce-Others/VIMAX-PILL-ORIGINAL-(4)">VIMAX PILL ORIGINAL PERMANENT (081126747616)</a></div>" & @CRLF I think this is a very difficult RegExp pattern, isn't it? Or how to grab that without RegExp? Thanks
  13. I'm thinking to create a web scrapper / crawler for personal used that accept RegExp. I am thinking something like this: c:>my-scrapper.exe /site:www.blabla.com /depth:5 /RegExp:SomeRegExpPatternHere /saveas:abc.txt Is that possible? Or maybe there is already available something like it that I can use?
×
×
  • Create New...