Sign in to follow this  
Followers 0
sammy1983

Unable to read gif image

40 posts in this topic

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
 
_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")
 

 

Share this post


Link to post
Share on other sites



Amazing!!! It worked.. Thanks a ton, Boss.. :-) Can I ask an additional help please?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.. :-)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

sammy1983,

I am worry free now

Best I solve the problem then - and I am far from a RegEx guru! :sweating:

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Verizon Wireless
Post Office Box 660108
Dallas, TX 75266-0108xxx>Exit code: 0

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Output:

Verizo
Wireless

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