AutoHotkey Community

It is currently May 26th, 2012, 4:03 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: April 11th, 2009, 9:55 pm 
Offline

Joined: March 17th, 2007, 7:51 pm
Posts: 45
Location: San Antonio, TX
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2009, 3:33 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2009, 5:11 am 
Offline

Joined: March 17th, 2007, 7:51 pm
Posts: 45
Location: San Antonio, TX
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2009, 8:05 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5478
Location: the tunnel(?=light)
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.

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2009, 8:38 am 
Offline

Joined: March 17th, 2007, 7:51 pm
Posts: 45
Location: San Antonio, TX
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2009, 4:43 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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).


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, G. Sperotto, gamax92, Google Feedfetcher and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group