Sign in to follow this  
Followers 0
danielzy

Trying to use FF.au3 to extract some information from a table

2 posts in this topic

Hey guys, I'm pretty new to autoit and I'm trying to use FF.au3 to extract some cells from a table which looks like that:

 

<table border="0" cellspacing="5" cellpadding="1">
        <tr>
            <td class="BlueInputKind" align="left" nowrap>HEADING1</td>
            <td  class="BlueInputKind" nowrap>HEADING2</td>
            <td class="BlueInputKind" nowrap>HEADING3</td>
            <td class="BlueInputKind" nowrap>HEADING4</td>
        </tr>
        <tr>
            <td class="BlackTextEng" dir="ltr">Text1</td>
            <td class="BlackTextCenter" valign="top"  dir="rtl">Number</td>
            <td nowrap class="BlackText" valign="top" nowrap>Text3</td>
        </tr>
        <tr>
            <td class="BlackTextEng" dir="ltr">Text1</td>
            <td class="BlackTextCenter" valign="top"  dir="rtl">Number</td>
            <td nowrap class="BlackText" valign="top" nowrap>Text3</td>
        </tr>
        <tr>
            <td class="BlackTextEng" dir="ltr">Text1</td>
            <td class="BlackTextCenter" valign="top"  dir="rtl">Number</td>
            <td nowrap class="BlackText" valign="top" nowrap>Text3</td>
        </tr>

My end goal is to:

If Text1 == something && Number > SomeNumber Then DoSomething

I managed to connect to firefox using repl and clicked some links etc but I'm not even close to achieving something like the above. Any help will be appreciated.

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • jfcby
      Firefox With MozRepl Does Not Work With Multiple Lines of Text
      By jfcby
      I have a script that sends multiple lines of text to a textbox using Firefox. I using _FFSetValue($sCellValue[7], "line one" & @CR & "line two", "id") from ff.au3. If it's a single line of text it works but MozRepl give the following error with multiple lines of text.
      Error:  
      __FFSend: try{FFau3.simulateEvent(window.content.top.document.getElementById('line one
      line two'),'Event','change',13);}catch(e){'_FFCmd_Err';};
      __FFWaitForRepl ==> Error return value: MozRepl ....>
      __FFSend: ;
      __FFRecv:
      __FFSend: FFau3.WCD=window.content.top.document;
      __FFWaitForRepl ==> Error return value: MozRepl ....>
      __FFRecv: !!! SyntaxError: unterminated string literal
      Details:

       [object HTMLDocument] - {mainForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, ...}
      !!! SyntaxError: unterminated string literal
      Will MozRepl plugin for Firefox send multiple lines of text to a textbox?
      Thanks for your help.
    • DrewSS
      javascript menu automation help - _FFCmd
      By DrewSS
      Hello,
      I'm looking for some direction with how to automate the exporting of an excel report through a javascript driven menu; unfortunately it does not support IE, so Firefox is what i've been trying, and I can navigate all the way through the dashboard and generate the report, but to export it I need to go through the menu. The menu has onmousedown and onmouseover events that I'm not sure how to send. It looks like I can do this with _FFCmd, but it may take several statements.. can someone help me get started?
       
      This is the path to export:
       
      <div id="mstr395" tstid="" class="mstrmojo-ListBase mstrmojo-ui-Menu unselectable mojo-theme-dark visible" style="top: 0px; right: 100%; bottom: auto; left: auto;"
      onclick="mstrmojo.dom.captureDomEvent('mstr395','click', self, event)"
      ondblclick="mstrmojo.dom.captureDomEvent('mstr395','dblclick', self, event)"
      onmousedown="mstrmojo.dom.captureDomEvent('mstr395','mousedown', self, event)"
      onmouseover="mstrmojo.dom.captureDomEvent('mstr395','mouseover', self, event)"
      onmouseout="mstrmojo.dom.captureDomEvent('mstr395','mouseout', self, event)"
      oncontextmenu="mstrmojo.dom.captureDomEvent('mstr395','contextmenu', self, event)">
      <div class="mstrmojo-ui-Menu-item-container" style="">
      <a class="item exportToExcel mstrmojo-ui-Menu-item" idx="0" style="" title="">
      <div class="micn"></div>Excel</a><a class="item exportToPDF mstrmojo-ui-Menu-item" idx="1" style="" title="">
       
      Sorry I cannot provide access to the dashboard as it has sensitive information. Any feedback is greatly appreciated!
       
       
       
       
       
    • taylansan
      Query SIM Card ICC ID Using FF.au3
      By taylansan
      Hello Dears,
      I'm trying to get the SIM card ICC ID number through the system using FF.au3. I have read the description of the UDF but I'm stuck on the query page after login. I have also tried to refresh the page to get the new XPath (hopelessly), but couldn't go any further. I'm basically trying to:
      Login to the system Click on the site map After site map opens, go to customer care Then change subscriber information Input the MSISDN (phone number) of subscriber and submit Get the SIM card ICC ID information and proceed to the next screen HotKeySet("{F6}", "_exit") #include <FF.au3> _01_loginPage() _02_clickSiteMap() _03_clickCustomerCare() _04_clickChangeSubscriberInfo() _05_fillPhoneNumberInfoAndSubmit() _06_getSIMCardInfo() Func _01_loginPage() $sBSSMainPage = "http://10.220.65.172:9889/login.action?ssoLogin=true" If _FFConnect() Then If _FFOpenURL($sBSSMainPage) Then _FFSetValue("TaylanY", _FFXPath(".//*[@id='username']"), "elements") _FFSetValue("WWee11!!", _FFXPath(".//*[@id='password']"), "elements") _FFClick(_FFXPath(".//*[@id='submitBtn']/div/div")) EndIf EndIf EndFunc Func _02_clickSiteMap() ;retry again and again until click the site map button While 1 Local $a = _FFXPath(".//*[@id='sitemap']/div") _FFClick($a) If Not @error Then MsgBox(0,"OK","Site Map Opening", 1) ExitLoop EndIf Sleep(1000) WEnd EndFunc Func _03_clickCustomerCare() ;retry again and again until click the customer care button While 1 _FFClick(_FFXPath(".//*[@id='newcustomer']/div")) If Not @error Then MsgBox(0,"OK","Customer Page Opening", 1) ExitLoop EndIf Sleep(1000) WEnd EndFunc Func _04_clickChangeSubscriberInfo() ;retry again and again until click the change subscriber info button While 1 _FFClick(_FFXPath(".//*[@id='sitemap']/div[12]/div[2]/div[2]/span[5]/a")) If Not @error Then MsgBox(0,"OK","Change Subscriber Info Page Opening", 1) ExitLoop EndIf Sleep(1000) WEnd EndFunc Func _05_fillPhoneNumberInfoAndSubmit() ;fill the MSISDN of the subscriber and submit While 1 ;enter subscriber phone number Local $a = _FFXPath(".//*[@id='serviceNo_input_value']") _FFSetValue("552237755", $a, "elements") If Not @error Then ;click the submit button Local $b = _FFXPath(".//*[@id='searchCustomer']/div/div") _FFClick($b) If Not @error Then MsgBox(0,"OK","Submit Customer Info Waiting for Result", 1) ExitLoop EndIf EndIf Sleep(1000) WEnd EndFunc Func _06_getSIMCardInfo() While 1 ;get the ICC ID of the SIM card $SIMCardXPath = _FFXPath(".//*[@id='iccid_input_value']") $ICCIDoftheCard = _FFGetValue($SIMCardXPath) ;click next button $nextbutton = _FFXPath(".//*[@id='nextBtn']/div/divf") _FFClick($nextbutton) If Not @error Then MsgBox(0,"OK","ICC ID of the SIM card is: " & $ICCIDoftheCard & " and Next Page", 1) ExitLoop EndIf Sleep(1000) WEnd EndFunc Func _exit() Exit EndFunc But after login to the billing system, my code cannot process the second function (clicking on site map):
      >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Taylan\Projects\AU3\BSS\test1 FF.au3" _FFConnect: OS: WIN_7 WIN32_NT 7601 Service Pack 1 _FFConnect: AutoIt: 3.3.8.1 _FFConnect: FF.au3: 0.6.0.2b _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 572 _FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; rv:44.0) Gecko/20100101 Firefox/44.0 __FFSendJavaScripts: Sending functions to FireFox .......... done _FFOpenURL: http://10.220.65.172:9889/login.action?ssoLogin=true __FFSend: try{window.content.top.document.location.href='http://10.220.65.172:9889/login.action?ssoLogin=true'}catch(e){'_FFCmd_Err';}; __FFRecv: http://10.220.65.172:9889/login.action?ssoLogin=true _FFLoadWait: .................. loaded in 4483ms [object HTMLDocument] - {_liveHttpHeaders: {...}, loginForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...} __FFSend: FFau3.WCD=window.content.top.document; __FFRecv: [object HTMLDocument] - {_liveHttpHeaders: {...}, loginForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...} [object HTMLDocument] - {_liveHttpHeaders: {...}, loginForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...} __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate(".//*[@id='username']",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: [object HTMLInputElement] - {stepUp: function() {...}, stepDown: function() {...}, checkValidity: function() {...}, setCustomValidity: function() {...}, select: function() {...}, setRangeText: function() {...}, setSelectionRange: function() {...}, ...} __FFSend: try{FFau3.xpath.value='TaylanY'}catch(e){'_FFCmd_Err';}; __FFRecv: TaylanY __FFSend: try{FFau3.simulateEvent(FFau3.xpath,'Event','change',13);}catch(e){'_FFCmd_Err';}; __FFRecv: 1 __FFSend: FFau3.WCD=window.content.top.document; __FFRecv: [object HTMLDocument] - {_liveHttpHeaders: {...}, loginForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...} [object HTMLDocument] - {_liveHttpHeaders: {...}, loginForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...} __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate(".//*[@id='password']",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: [object HTMLInputElement] - {stepUp: function() {...}, stepDown: function() {...}, checkValidity: function() {...}, setCustomValidity: function() {...}, select: function() {...}, setRangeText: function() {...}, setSelectionRange: function() {...}, ...} __FFSend: try{FFau3.xpath.value='WWee11!!'}catch(e){'_FFCmd_Err';}; __FFRecv: WWee11!! __FFSend: try{FFau3.simulateEvent(FFau3.xpath,'Event','change',13);}catch(e){'_FFCmd_Err';}; __FFRecv: 1 __FFSend: FFau3.WCD=window.content.top.document; __FFRecv: [object HTMLDocument] - {_liveHttpHeaders: {...}, loginForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...} [object HTMLDocument] - {_liveHttpHeaders: {...}, loginForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...} __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate(".//*[@id='submitBtn']/div/div",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: [object HTMLDivElement] - {align: "center", click: function() {...}, focus: function() {...}, blur: function() {...}, title: "", lang: "", dir: "", ...} __FFSend: try{FFau3.simulateEvent(FFau3.xpath,'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: 1 _FFLoadWait: . loaded in 10ms [object HTMLDocument] - {_liveHttpHeaders: {...}, loginForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...} __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate(".//*[@id='sitemap']/div",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: __FFSend: try{FFau3.simulateEvent(FFau3.xpath,'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: -3 _FFClick ==> No match: $sElement: FFau3.xpath __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate(".//*[@id='sitemap']/div",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: _FFXPath_Error: TypeError: can't access dead object _FFXPath ==> Error return value: _FFXPath_Error: TypeError: can't access dead object __FFSend: try{FFau3.simulateEvent(0,'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: -3 _FFClick ==> No match: $sElement: 0 __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate(".//*[@id='sitemap']/div",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: _FFXPath_Error: TypeError: can't access dead object _FFXPath ==> Error return value: _FFXPath_Error: TypeError: can't access dead object __FFSend: try{FFau3.simulateEvent(0,'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: -3 _FFClick ==> No match: $sElement: 0 __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate(".//*[@id='sitemap']/div",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: _FFXPath_Error: TypeError: can't access dead object _FFXPath ==> Error return value: _FFXPath_Error: TypeError: can't access dead object __FFSend: try{FFau3.simulateEvent(0,'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: -3 _FFClick ==> No match: $sElement: 0 __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate(".//*[@id='sitemap']/div",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: _FFXPath_Error: TypeError: can't access dead object _FFXPath ==> Error return value: _FFXPath_Error: TypeError: can't access dead object __FFSend: try{FFau3.simulateEvent(0,'MouseEvents','click');}catch(e){'_FFCmd_Err';}; __FFRecv: -3 _FFClick ==> No match: $sElement: 0 >Exit code: 0 Time: 13.335 I don't know why it says as a dead object to the place where I want to click. Here, you see in the screenshots that, my XPath is actually correct.
      Please advice me how to proceed from the second function till I get the subscriber information.
      Thank you in advance.






    • tommytx
      FF autoit not going past the first URL.
      By tommytx
      Has anything changed recently with how FF interacts with autoit.. I cannot get it to do anything past start the first url and just hangs at that piont.
      here is the code i am using..
      The only thing it does is open up the vahud.com and never moves on to the test.htm page.. and does this on all my FF autoit programs..
      I am using XP but it has alwasy been fine in the past..
       
      #Include <FF.au3> _FFStart("http://vahud.com") Sleep(2000) _FFAction("presentationmode", True) Sleep(2000) _FFOpenURL("http://vahud.com/test.htm") Sleep(2000) Exit and here is the rusults i obtain.
       
      __FFStartProcess: ""C:\Program Files\Mozilla Firefox\firefox.exe" -new-window "http://vahud.com" "-repl 4242 " _FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3 _FFConnect: AutoIt: 3.3.12.0 _FFConnect: FF.au3: 0.6.0.1b-10 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect ==> Timeout: TCPConnect Error: 10061 _FFConnect ==> General Error: Timeout: Can not connect to FireFox/MozRepl on: 127.0.0.1:4242 __FFSend ==> Socket Error _FFCmd ==> Error return value _FFOpenURL: http://vahud.com/test.htm __FFSend ==> Socket Error _FFCmd ==> Error return value _FFOpenURL ==> No match: http://vahud.com/test.htm >Exit code: 0 Time: 72.04  
    • bagas9425
      Send email when get error on Firefox/FF.au3
      By bagas9425
      Hi, all.
      I want to know how to send an email when FF.au3 got error.
      I have made in IE and it worked.
      But, FF cannot handle global error.
       
      Can you all help me?
      Thanks.