AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need COM obeject stored to var so i can regex it

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Cereal



Joined: 17 Mar 2007
Posts: 45
Location: San Antonio, TX

PostPosted: Sat Apr 11, 2009 8:55 pm    Post subject: Need COM obeject stored to var so i can regex it Reply with quote

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
View user's profile Send private message AIM Address
tank



Joined: 21 Dec 2007
Posts: 3700
Location: Louisville KY USA

PostPosted: Sun Apr 12, 2009 2:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Cereal



Joined: 17 Mar 2007
Posts: 45
Location: San Antonio, TX

PostPosted: Sun Apr 12, 2009 4:11 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
sinkfaze



Joined: 18 Mar 2008
Posts: 5043
Location: the tunnel(?=light)

PostPosted: Sun Apr 12, 2009 7:05 am    Post subject: Reply with quote

Perhaps a better solution would be to download the URL to a variable then RegEx the html to match for that name.

Here is the COM process for UrlDownloadToVar.
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
Cereal



Joined: 17 Mar 2007
Posts: 45
Location: San Antonio, TX

PostPosted: Sun Apr 12, 2009 7:38 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Lexikos



Joined: 17 Oct 2006
Posts: 7293
Location: Australia

PostPosted: Sun Apr 12, 2009 3:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group