Sign in to follow this  
Followers 0
LukeJrs

I need help _IECreate,_INetGetSource

33 posts in this topic

I'm trying to log-in to my work website first IECreate url then log-in once login is done, use same window that IE is activate and open another url in same activate IE once done loading then read a text on website like a zipcode 37283-2343 and copy 37283 only 5 digit and open another url with current value of 37283 and attach it to the value result like www.google.com/search?37283 will open like that etc.? Is this possible I read manual but can't figure it out.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Please try that again with more careful description of what you are trying to do and what you have tried.

Also, try adding some punctuation to your description... one long run-on sentence doesn't make it easy for someone to understand your multi-step process.

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thank for the reply.

I'm tried learning IE command, But I have no luck....

The project that i'm currently working on is very simple but hard to programmed.

Step-by-Step Proccess.

1) Open Internet Explore hidden or non-hidden with www.example.com/members

2) Log-In in www.example.com/members in active IE that we opened moment ago.

3) Then Open url on active IE using this url www.example.com/phone.php?mtn=2393453454 So I can have access to search mobile number P.S I cant use search function until i'm log-in.

4) Once page is loaded the customer information will show on html form I need to grab a zipcode on that html body it's written like ZIP: 33982-2734 all I need is first 5 digit ignore the rest text string only save the first 5 digit.

5)Open url www.example.com/phone?mnt=2393453454&ZIP= <----------here when use Value was copy and save to memory would be 33982 so the output of url would be

www.example.com/phone?mnt=2393453454&ZIP=33982

Is't possible? I'm so sorry causing you confuse with all grammatical errors.

P.S english is not my primary language.

Edited by LukeJrs

Share this post


Link to post
Share on other sites

#include <IE.au3>

; Create a browser window and navigate to gmail

$oIE = _IECreate()

_IENavigate($oIE, "http://www.gmail.com")

; get pointers to the login form and username and password fields

$o_form = _IEFormGetObjByName($oIE, "gaia_loginform")

$o_login = _IEFormElementGetObjByName($o_form, "Email")

$o_password = _IEFormElementGetObjByName($o_form, "Passwd")

; Set field values and submit the form

_IEFormElementSetValue($o_login, "test")

_IEFormElementSetValue($o_password, "test")

_IEFormSubmit($o_form)

Sleep(10000)

_IENavigate($oIE, "http://www.hotmail.com")

Exit

All im missing step 4 and step five

Share this post


Link to post
Share on other sites

You should take a look at _IEBodyReadText or _IEBodyReadHTML to get your zip-code. If it's in a table, _IETableWriteToArray might be even better. After you get the text, you just need to do some string manipulation. For this, try functions like StringTrim, StringBetween, etc.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

I tried _IEBodyReadText and read all body of html but how can i make read the specific text ZIP:

and get value number a store as a memory to manipulate using

$result = StringTrimRight("33982-2734", 5)

MsgBox(0, "String without leftmost 3 characters is:", $result)

Share this post


Link to post
Share on other sites

What you just posted will return "33982" from "33982-2734"....

Are you having trouble getting "33982-2734" from the webpage? If so, post the what your _IEBodyReadText is giving you.

PS. Try using the codeboxes in your forum posts.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I'll provide you more about zip code in html when i go back to work, I'm currently on vacation using my brain to programmed for work task Silly me how i spend my vacation.

I have a question...

let say:

CODE
_IENavigate ($oIE, "http://www.example.com/phone?mnt=239345" & Number(1+2+10))

that equal to www.example.com/phone?mnt=23934513 let say I wanted to start from 239345 and add 0001 to make it like 2393450001 will open a page as

CODE
_IENavigate ($oIE, "http://www.example.com/phone?mnt=2393450001))
and next time open the _IENavigate use 0002,0003 like opening page 1 by 1 just adding.

Example let say i wanted to open 100 pages and look for a text meant while have 2393450001 to 2393450100 all 100 page open muti-tasking looking for string and saving it to a txt file can it be done?.

Edited by LukeJrs

Share this post


Link to post
Share on other sites

100 pages open at once might cause your CPU to have a heart attack. But if that's what you want to do, just create a loop and add one to an $url variable.

#include <IE.au3>

$url = "http://www.example.com/phone?mnt="
$number = 2393450001

For $i = 0 To 99
    $trueURL = $url & $number
    $oIE = _IECreate($trueURL)
    $number += 1
NextoÝ÷ Ø(ºWm)äÜ(ºW[y¦Þ¶×«×¶î²ÙÚ¾(µê'yºèÂÇ«¶rÊ«¥¨°p¢}ý¶Ö¤zZ'ú++;¬¶Ç­ÈZÛ-¢·­{ZºÚ"µÍÚ[ÛYH  ÒQK]LÉÝÂÌÍÝH ][ÝÚËÝÝÝË^[KÛÛKÜÛOÛ[I][ÝÂÌÍÛ[XHÎLÍ
LBÌÍÛÒQHHÒQPÜX]J
BÜ ÌÍÚHHÈNBIÌÍÝYUTH ÌÍÝ  [È ÌÍÛ[XIÌÍÛÒQHHÒQS]]J  ÌÍÝYUT
BNÙÜX^BIÌÍÛ[X
ÏHB^

Good luck.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

If you must format a number as a string with leading zeros for appending to the URL, check out StringFormat() to do the job.

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

thanks for the help :whistle: i'm almost done with project hehe i'll check it out.

P.S Thanks for the code IENavigate is a good idea but

CODE
#include <IE.au3>

$url = "http://www.example.com/phone?mnt="

$number = 2393450001

$oIE = _IECreate()

For $i = 0 To 99

$trueURL = $url & $number

$oIE = _IENavigate($trueURL)

;grab text here

$number += 1

Next

is not working I get an Error

(9) : ==> Incorrect number of parameters in function call.:

$oIE = _IENavigate($trueURL)

$oIE = ^ ERROR

>Exit code: 1 Time: 0.870

should be like

CODE
#include <IE.au3>

$url = "http://www.example.com/phone?mnt="

$number = 2393450001

$oIE = _IECreate()

For $i = 0 To 99

$trueURL = $url & $number

_IENavigate($oIE, $trueURL)

;grab text here

$number += 1

Next

Edited by LukeJrs

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

the zipcode that i wanted to read wont read cannot be found due to the html i tried to read have a frame

CODE
<html>

<head>

<title>***** </title>

</head>

<frameset id="idTeleClientFS" name="TeleClientFS" rows="*,0px" framespacing=0 frameborder="no" >

<frame name="teleClientContents" id="idTeleClientContents" src="TeleClient.jsp?MOBILE_NUMBER=2399990000"

scrolling="yes" frameborder="0" marginheight=0 marginwidth=0>

</frame>

<!-- This is the lookup Area panel -->

<frame name="teleClientLookup" id="idTeleClientLookup" src="./templates/Empty.html"

scrolling="no" frameborder="0" marginheight=0 marginwidth=0 noresize>

</frame>

</frameset>

</html>

also the zip code that im looking for is not in html source to view.

CODE
<td>

<font class="lblTypeA">Zip :</font>

</td>

<td>

<input type=text readOnly class="txtTypeA" size=9 name="clientZip" value="">

</td>

The zip code is 344410000 it show it seem read it from the server but i can view it but when i look at source code is not there.

I notice there lots javascript loading that page.... any idea how can i have it read the text between?to capture 34441 zipcode how can it be done? sound like javascript cause to generate the value of zipcode.. any idea?

what if i wanted to fire event of javascript how can i fire it? <input type=button class="btnTypeA" name="btnSummary" value="Show Details" onclick="showCustomerDetails( this, true );" />

Edited by LukeJrs

Share this post


Link to post
Share on other sites

Could I visit the URL, or is it confidential?


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

is business url intranet access :\ sorry if only you worked my job than would be big help.

meant while is there a method to get a string of text or a text located on that position? because the zip: 399990000 is there but i need to grab it and trimright to cut it

CODE
$result = StringTrimRight("399990000", 4)

MsgBox(0, "String without leftmost 3 characters is:", $result)

But what i need is something that will find the vaue located in zip code even though doesnt show it on html source? any idea? how to grab it?

Edited by LukeJrs

Share this post


Link to post
Share on other sites

If it's JS that's presenting the zip code, and it's not in the source, you should be able to read the value of:

<input type=text readOnly class="txtTypeA" size=9 name="clientZip" value="">

if that's where the zip code appears. Just be sure to do it after the JS populates it.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

it show on the screen after JS populates it but can't view them in source. will only show

<input type=text readOnly class="txtTypeA" size=9 name="clientZip" value=""> but there no value in it. but as my view i see the zip code i can highlight it it's there but when you view source is no where to be found.

Edited by LukeJrs

Share this post


Link to post
Share on other sites

it show on the screen after JS populates it but can't view them in source. will only show

<input type=text readOnly class="txtTypeA" size=9 name="clientZip" value=""> but there no value in it. but as my view i see the zip code i can highlight it it's there but when you view source is no where to be found.

You wouldn't read it from the page source. Use _IEFormElementGetValue().

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thank you all so much i'll give it a try appreciate your time and work thanks again.

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

How will i be able get the value of a input and manipulate the string to make it like

CODE
#include <IE.au3>

$oIE = _IE_Example ("form")

$IE = _IECreate()

$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")

$oText = _IEFormElementGetObjByName ($oForm, "textareaExample")

MsgBox(0, "Form Element Value", _IEFormElementGetValue ($oText))

_IENavigate ($IE , "www.google.com" & "/" & $oText)

the result come to Hello! but i want to navigate same window and use the result add www.google.com/ with the string Hello! make it like www.google.com/Hello!

Nvm i figre it lol

CODE
#include <IE.au3>

$oIE = _IE_Example ("form")

$IE = _IECreate()

$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")

$oText = _IEFormElementGetObjByName ($oForm, "textareaExample")

MsgBox(0, "Form Element Value", _IEFormElementGetValue ($oText))

_IENavigate ($IE , "www.google.com" & "/" & _IEFormElementGetValue ($oText))

Edited by LukeJrs

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

Hi i'm having a break down on my brain :\ I need your help again

Let say in html source there a string like 130/27 or 30/923 the number is generated random by each customer account depend on their usage.

Let say i wanted grab the specific text of value of 130/27 and add them up will output 157 then compare to another value like if 157 is greater than 30 then Found if value 1 not greater than 30 not found. Sound confusing?

They written in <td></td>

CODE
#include <INet.au3>

#include <array.au3>

#include <String.au3>

$html = _INetGetSource('http://uk.weather.com/weather/local/UKXX0085')

$sStart = "<B>Feels Like<BR>"

$sEnd = "&deg"

$Array1 = _StringBetween ($html, $sStart, $sEnd)

_ArrayToClip ($Array1)

$result = (ClipGet())

MsgBox(0, "London feels like:", $result & " Degrees Centigrade")

very interesting code but doesnt work as much i wanted to let say i wanted to grab <td>130/27</td> but it grab 130/27 as result can i add them both to make it 157? and then compare like

CODE

If $result >= 34 Then

MsgBox(4096,"", "We got data.")

ElseIf $result <= 33 Then

MsgBox(4096,"", "We got No data.")

EndIf

Edited by LukeJrs

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