sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 17 minutes ago, iamtheky said: add is the layperson term, for offering as an addendum. He means quite literally copy that function and paste it into your script (at the very bottom would probably be the most logical place) prior to hitting F5/F7. Thanks for clarifying iamtheky. I did that now. Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 46 minutes ago, mLipok said: As I said add this function to your main script. mLipok, I added the function at the bottom of the main script and received outputs, however, I didn't get anything having folderid value. Link to comment Share on other sites More sharing options...
MichaelHB Posted March 29, 2016 Share Posted March 29, 2016 15 minutes ago, sammy1983 said: My apologies MichaelHB. I tried this earlier and no success. Make sure you are attaching to the right "instance" of the IE. I tested that code here in differents websites, always work. Have you tried again with that code ? What are the error(s) it gives? Can you share the website you are trying to do that? Link to comment Share on other sites More sharing options...
mLipok Posted March 29, 2016 Share Posted March 29, 2016 I'm sorry but I'm a little busy today. By this, even I misread your opening post. Now I think the example from @MichaelHB is easier way. Keep following his sugestion to this case. Sorry for confusion. btw. did you read: How to use IE.au3 UDF with AutoIt v3.3.14.x Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 15 minutes ago, MichaelHB said: Make sure you are attaching to the right "instance" of the IE. I tested that code here in differents websites, always work. Have you tried again with that code ? What are the error(s) it gives? Can you share the website you are trying to do that? Here is my complete code. Due to security reasons, I will not be able to reveal the actual site. expandcollapse popup#NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(5000) $sHTML = _IEDocReadHTML($oIE) $array2 = StringRegExp($sHTML, '(?i)pageHeaderCandidateName">\s*(.*?)\s*</(?i)span>', 3) For $p = 0 To UBound($array2) - 1 $CandName = $array2[$p] ExitLoop Next $oIEF = _IEAttach("Talent Record", "instance", 1) $Elements = $oIEF.document.getElementsByName("folderid") MsgBox(0, "Number of Elements", $Elements.length) For $i = 0 to $Elements.length - 1 MsgBox(0, "Element number: " & $i+1, $Elements.item($i).value) Next MsgBox(64, "Record Located - " & $RKey, "Found candidate - " & $CandName & ". Preparing Talent Record.") Exit Link to comment Share on other sites More sharing options...
MichaelHB Posted March 29, 2016 Share Posted March 29, 2016 Try this way. Look at the comments in the code. expandcollapse popup#NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(15000) ;make sure the website is completely loaded $sHTML = _IEDocReadHTML($oIE) $array2 = StringRegExp($sHTML, '(?i)pageHeaderCandidateName">\s*(.*?)\s*</(?i)span>', 3) For $p = 0 To UBound($array2) - 1 $CandName = $array2[$p] ExitLoop Next ;$oIEF = _IEAttach("Talent Record", "instance", 1) ; why are you attaching again? this is the same website in $oIE right? $Elements = $oIE.document.getElementsByName("folderid") MsgBox(0, "Number of Elements", $Elements.length) ;tell me how many elements this returns? 5? For $Element In $Elements MsgBox(0, "Element Value", $Element.value) ;if this gives you any error, paste the error. Next MsgBox(64, "Record Located - " & $RKey, "Found candidate - " & $CandName & ". Preparing Talent Record.") Exit Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 9 minutes ago, MichaelHB said: Try this way. Look at the comments in the code. expandcollapse popup#NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(15000) ;make sure the website is completely loaded $sHTML = _IEDocReadHTML($oIE) $array2 = StringRegExp($sHTML, '(?i)pageHeaderCandidateName">\s*(.*?)\s*</(?i)span>', 3) For $p = 0 To UBound($array2) - 1 $CandName = $array2[$p] ExitLoop Next ;$oIEF = _IEAttach("Talent Record", "instance", 1) ; why are you attaching again? this is the same website in $oIE right? $Elements = $oIE.document.getElementsByName("folderid") MsgBox(0, "Number of Elements", $Elements.length) ;tell me how many elements this returns? 5? For $Element In $Elements MsgBox(0, "Element Value", $Element.value) ;if this gives you any error, paste the error. Next MsgBox(64, "Record Located - " & $RKey, "Found candidate - " & $CandName & ". Preparing Talent Record.") Exit Here you go.... No. of elements - 10 Error below Link to comment Share on other sites More sharing options...
MichaelHB Posted March 29, 2016 Share Posted March 29, 2016 (edited) This probably mean that some elements with that name "folderid" does not have any value, we could check one by one looking with ".hasAttributes()", but lets try a different approach. Try this: expandcollapse popup#NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(15000) ;make sure the website is completely loaded $sHTML = _IEDocReadHTML($oIE) $array2 = StringRegExp($sHTML, '(?i)pageHeaderCandidateName">\s*(.*?)\s*</(?i)span>', 3) For $p = 0 To UBound($array2) - 1 $CandName = $array2[$p] ExitLoop Next Local $aFolderID = StringRegExp($sHTML, '(?i)<div value="(.*?)" name="folderid"></div>', 3) _ArrayDisplay($aFolderID) ;tell me with this shows the result that you want MsgBox(64, "Record Located - " & $RKey, "Found candidate - " & $CandName & ". Preparing Talent Record.") Exit Edited March 29, 2016 by MichaelHB Changed the StringRegExp to global (i dont know if theres more than one match) Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 1 hour ago, MichaelHB said: This probably mean that some elements with that name "folderid" does not have any value, we could check one by one looking with ".hasAttributes()", but lets try a different approach. Try this: expandcollapse popup#NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(15000) ;make sure the website is completely loaded $sHTML = _IEDocReadHTML($oIE) $array2 = StringRegExp($sHTML, '(?i)pageHeaderCandidateName">\s*(.*?)\s*</(?i)span>', 3) For $p = 0 To UBound($array2) - 1 $CandName = $array2[$p] ExitLoop Next Local $aFolderID = StringRegExp($sHTML, '(?i)<div value="(.*?)" name="folderid"></div>', 3) _ArrayDisplay($aFolderID) ;tell me with this shows the result that you want MsgBox(64, "Record Located - " & $RKey, "Found candidate - " & $CandName & ". Preparing Talent Record.") Exit Nope. No output. I even tried with the below format. Any problem with the StringExpression? $sHTML = _IEDocReadHTML($oIE) $array6 = StringRegExp($sHTML, '(?i)<div value="(.*?)" name="folderid"></div>', 3) For $q = 0 To UBound($array6) - 1 $FolderID = $array6[$q] MsgBox(0, "", $FolderID) Next Link to comment Share on other sites More sharing options...
mLipok Posted March 29, 2016 Share Posted March 29, 2016 _IEFrameGetCollection($oIE, -1) MsgBox(0, 'Frame count', @extended) What you see ? Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 2 minutes ago, mLipok said: _IEFrameGetCollection($oIE, -1) MsgBox(0, 'Frame count', @extended) What you see ? Link to comment Share on other sites More sharing options...
mLipok Posted March 29, 2016 Share Posted March 29, 2016 (edited) So this should help you: Local $oIE2 = _IEFrameGetCollection($oIE, 1) Now try to use this new $oIE2. HINT: Each frame is different document. EDIT: You can also try to use: Local $oIE2 = _IEFrameGetCollection($oIE, 0) Edited March 29, 2016 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 8 minutes ago, mLipok said: So this should help you: Local $oIE2 = _IEFrameGetCollection($oIE, 1) Now try to use this new $oIE2. HINT: Each frame is different document. EDIT: You can also try to use: Local $oIE2 = _IEFrameGetCollection($oIE, 0) I used the below codes, no output. Am I doing anything wrong? Local $oIE2 = _IEFrameGetCollection($oIE, 0) $sHTML = _IEDocReadHTML($oIE2) $array6 = StringRegExp($sHTML, '<div(?i) value="(.*?)" name="folderid"></div>', 3) For $q = 0 To UBound($array6) - 1 $FolderID = $array6[$q] MsgBox(0, "", $FolderID) Next Local $oIE2 = _IEFrameGetCollection($oIE, 1) $sHTML = _IEDocReadHTML($oIE2) Local $aFolderID = StringRegExp($sHTML, '(?i)<div value="(.*?)" name="folderid"></div>', 3) _ArrayDisplay($aFolderID) ;tell me with this shows the result that you want Link to comment Share on other sites More sharing options...
MichaelHB Posted March 29, 2016 Share Posted March 29, 2016 Lets check something sammy1983, use this code and paste the code in the notepad that look if you can find this expression: name="folderid" #NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(15000) ;make sure the website is completely loaded $sHTML = _IEDocReadHTML($oIE) ConsoleWrite($sHTML) ClipPut($sHTML) exit I used the piece of the html code that is in your first post. The "_IEDocReadHTML($oIE)" should extract the outerhtml and if the element "folderid" exists you should be able to find in the notepad. Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 9 minutes ago, MichaelHB said: Lets check something sammy1983, use this code and paste the code in the notepad that look if you can find this expression: name="folderid" #NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(15000) ;make sure the website is completely loaded $sHTML = _IEDocReadHTML($oIE) ConsoleWrite($sHTML) ClipPut($sHTML) exit I used the piece of the html code that is in your first post. The "_IEDocReadHTML($oIE)" should extract the outerhtml and if the element "folderid" exists you should be able to find in the notepad. 5 instances as below. <div name="folderid" value="82992"></div> <div name="folderid" value="82992"></div> <div name="folderid" value="82992"></div> <div name="folderid" value="82992"></div> <div name="folderid" value="82992"></div> Link to comment Share on other sites More sharing options...
MichaelHB Posted March 29, 2016 Share Posted March 29, 2016 Now i see, the sample you provide in the first post was incorret (as i suspect) . Try this: expandcollapse popup#NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(15000) ;make sure the website is completely loaded $sHTML = _IEDocReadHTML($oIE) $array2 = StringRegExp($sHTML, '(?i)pageHeaderCandidateName">\s*(.*?)\s*</(?i)span>', 3) For $p = 0 To UBound($array2) - 1 $CandName = $array2[$p] ExitLoop Next Local $aFolderID = StringRegExp($sHTML, '(?i)<div name="folderid" value="(.*?)"></div>', 3) _ArrayDisplay($aFolderID) ;tell me with this shows the result that you want MsgBox(64, "Record Located - " & $RKey, "Found candidate - " & $CandName & ". Preparing Talent Record.") Exit Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 17 minutes ago, MichaelHB said: Now i see, the sample you provide in the first post was incorret (as i suspect) . Try this: expandcollapse popup#NoTrayIcon #include <IE.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> #include <Debug.au3> #include <Excel.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $aRecords Local $FolderID, $HWND, $RKey, $BRID, $oIE, $oIE1, $oFrames, $test Local $m, $n, $p, $test1, $CandName, $array, $array1, $array2, $array3 Local $RKey = InputBox("Talent Record", "Enter Candidate Ref ID", "", "", 50) $oIE = _IECreate("https://abcd.com" & $RKey) Sleep(15000) ;make sure the website is completely loaded $sHTML = _IEDocReadHTML($oIE) $array2 = StringRegExp($sHTML, '(?i)pageHeaderCandidateName">\s*(.*?)\s*</(?i)span>', 3) For $p = 0 To UBound($array2) - 1 $CandName = $array2[$p] ExitLoop Next Local $aFolderID = StringRegExp($sHTML, '(?i)<div name="folderid" value="(.*?)"></div>', 3) _ArrayDisplay($aFolderID) ;tell me with this shows the result that you want MsgBox(64, "Record Located - " & $RKey, "Found candidate - " & $CandName & ". Preparing Talent Record.") Exit Awesome!!!! Link to comment Share on other sites More sharing options...
MichaelHB Posted March 29, 2016 Share Posted March 29, 2016 Glad you could do it. Link to comment Share on other sites More sharing options...
sammy1983 Posted March 29, 2016 Author Share Posted March 29, 2016 (edited) 25 minutes ago, MichaelHB said: Glad you could do it. Hey MichaelHB... Thanks a ton for your help today. No words to express my gratitude. Thanks again. $sHTML = _IEDocReadHTML($oIE) Local $aFolderID = StringRegExp($sHTML, '(?i)<div name="folderid" value="(.*?)"></div>', 3) For $q = 0 To UBound($aFolderID) - 1 $FolderID = $aFolderID[$q] MsgBox(0, "Success", $FolderID) Next Edited March 29, 2016 by sammy1983 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now