| View previous topic :: View next topic |
| Author |
Message |
Cereal
Joined: 17 Mar 2007 Posts: 45 Location: San Antonio, TX
|
Posted: Sat Apr 11, 2009 8:55 pm Post subject: Need COM obeject stored to var so i can regex it |
|
|
okay so i need to find patterns on a webpage, how can i set my COMobject outputted to a var so i can search through it?? here is my code so far
| Code: | #include COM.ahk
COM_Init()
pwb := COM_CreateObject("InternetExplorer.Application")
;COM_Invoke(pwb , "Visible=", "True")
COM_Invoke(pwb, "Navigate", "http://website.com/")
iWeb_complete(pwb)
COM_Invoke(pwb,"document.all.item[login].value","email")
COM_Invoke(pwb,"document.all.item[password].value","password")
COM_Invoke(pwb,"document.all.item[commit].click")
COM_Invoke(pwb, "Navigate", "http://website.com/go/here")
iWeb_complete(pwb)
COM_CoUninitialize()
iWeb_complete(pwb)
{
If pwb is not Integer
ExitApp
loop 10
{
If not (rdy:=COM_Invoke(pwb,"readyState") = 4)
Break
Sleep,100
}
loop 80
{
If (rdy:=COM_Invoke(pwb,"readyState") = 4)
Return 1
Sleep,500
}
Return 0
}
MsgBox, %pwb%
ExitApp |
|
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Sun Apr 12, 2009 2:33 am Post subject: |
|
|
OK so im confused what are you wanting to examine
some text?
subject lines?
does the element have an id attribute
what shows when you use the dom viewer and mouse over it _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
Cereal
Joined: 17 Mar 2007 Posts: 45 Location: San Antonio, TX
|
Posted: Sun Apr 12, 2009 4:11 am Post subject: |
|
|
yah each element has a id and a class, but the id changes so i just need to be able to save the html to a variable, so i can use regex to go through the var and find the id, then i can use COM to manipulate the id
| Code: | | <input type="radio" title="13411" class="r" value="13411" id="13411" name="survey[1350][3122]" style="display: none;"/> |
title value id and name change , and if i can save it to a variable regex can easily pick that up |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5043 Location: the tunnel(?=light)
|
|
| Back to top |
|
 |
Cereal
Joined: 17 Mar 2007 Posts: 45 Location: San Antonio, TX
|
Posted: Sun Apr 12, 2009 7:38 am Post subject: |
|
|
| yah, i know i could do that, but it seams like its resource hungry to do that, want ot use the page i already have stored as a object just in useable form |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7293 Location: Australia
|
Posted: Sun Apr 12, 2009 3:43 pm Post subject: |
|
|
| I would think Internet Explorer is more resource hungry than UrlDownloadToVar, but if you specifically need the browser window, you could use the innerHTML property of the HTML element, document.body.innerHTML (body only) or document.documentElement.innerHTML (entire document). |
|
| Back to top |
|
 |
|