sammy1983 Posted February 8, 2014 Share Posted February 8, 2014 Hi, Day by day I am experimenting on new Autoit techniques and I am getting new projects in my office to automate many manual processes. One among those I am having trouble with. Here it is. I am entering below URL in browser. http://www.verizonwireless.com/wcms/contact-us.html#Payment_Address In the Zip search field I am entering, for example, "72640" and click on "Search". This gives me an address. Now here is what I couldn't do is or rather what I want to do is retrieve that image info in a notepad. Thanks for any help here. I'll be very grateful for this new learning. Below is so far code written on this. #include <IE.au3> #include <Date.au3> #include <String.au3> #Include <Array.au3> #include <Debug.au3> #include <Excel.au3> #NoTrayIcon Dim $aRecords ProcessClose("iexplore.exe") ; Open IE and login to URL $oIE = _IECreate ("http://www.verizonwireless.com/wcms/contact-us.html#Payment_Address") _IELoadWait($oIE) $Zip = "72640" Local $oQuery1 = _IEGetObjByName($oIE, "paymentAddressZip") _IEFormElementSetValue ($oQuery1, $Zip) Local $oQuery2 = _IEGetObjByName($oIE, "mailAddressZipButton") _IEAction($oQuery2, "click") _IELoadWait($oIE) Local $oQuery3 = _IEGetObjByName($oIE, "mailaddrbyzipcode") Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2014 Share Posted February 8, 2014 Try _IEPropertyGet($oQuery3, "innertext") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 Amazing!!! It worked.. Thanks a ton, Boss.. :-) Can I ask an additional help please? Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2014 Share Posted February 8, 2014 Do whatever you want pal. Xandy 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 I wanna split the address in Notepad like this. Line 1: Verizon Wireless Line 2: Post Office Box 660108 Line 3: Dallas Line 4: TX Line 5: 75266 Line 6: 0108 Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 I got the entire address in Notepad but now trying to split it. It would be great if u can extend ur help as well.. :-) Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2014 Share Posted February 8, 2014 Probably require some StrinRegEx voodoo. I'm lousy at that. There are plenty of regex magicians here though. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 Thank you so much for helping me out and I have made a note of your code. Thanks again. Will wait for someone to pull me out from this trouble. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 8, 2014 Moderators Share Posted February 8, 2014 sammy1983,We know what you want to achieve - please post the original text that you get so that we can see what is needed. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 JohnOne helped me in fetching the complete address and I am able to bring that to notepad but the challenge is that I want to break up the address as I mentioned above and put to excel cells. I am stuck with how to break the content like above one. Honestly, when I was posting this, I prayed Melba should also step in. I am worry free now. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 8, 2014 Moderators Share Posted February 8, 2014 sammy1983,I am worry free nowBest I solve the problem then - and I am far from a RegEx guru! So as i asked before please post the complete address as it appears in Notepad so that we can see how to break it up. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2014 Share Posted February 8, 2014 You need to post the text exactly how you get it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 Opens notepad and first 2 lines empty. 3rd line: Verizon Wireless 4th: empty 5th line: Post Office Box 660108 6th: empty 7th line: Dallas, TX 75266-0108 Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2014 Share Posted February 8, 2014 Do this. Consolewrite(_IEPropertyGet($oQuery3, "innertext") & "xxx") Copy and past the resulting text from console without interference. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 Verizon Wireless Post Office Box 660108 Dallas, TX 75266-0108xxx>Exit code: 0 Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2014 Share Posted February 8, 2014 I jump through many hoops to get around regex, here's what I'd try. ; reat of your code $s = _IEPropertyGet($oQuery3, "innertext") $endstring = "" $a = StringSplit($s, @LF, 2) For $i = 0 To 1 $endstring &= $a[$i] & @LF Next $a = StringSplit($a[2], " " & "-", 2) $a[0] = StringTrimRight($a[0], 1) For $i = 0 To UBound($a) -1 $endstring &= $a[$i] & @LF Next ConsoleWrite($endstring) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 Thanks JohnOne but got error. Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $a = StringSplit($a[2], " " & "-", 2) $a = StringSplit(^ ERROR Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2014 Share Posted February 8, 2014 Try changing to... $a = StringSplit($s, @CRLF, 2) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sammy1983 Posted February 8, 2014 Author Share Posted February 8, 2014 Output: Verizo Wireless Link to comment Share on other sites More sharing options...
JohnOne Posted February 8, 2014 Share Posted February 8, 2014 Try @CR AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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