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 

Watching Firefox's current page (only for IE)
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
silkcom



Joined: 23 Jan 2008
Posts: 154

PostPosted: Tue Oct 28, 2008 5:04 pm    Post subject: Watching Firefox's current page (only for IE) Reply with quote

Is there a way to find a current firefox window by title, and get the html code from the page?

Last edited by silkcom on Wed Jan 07, 2009 9:25 pm; edited 3 times in total
Back to top
View user's profile Send private message
hugov



Joined: 27 May 2007
Posts: 2448

PostPosted: Tue Oct 28, 2008 5:18 pm    Post subject: Reply with quote

1) Retrieve AddressBar of Firefox through DDE Message
http://www.autohotkey.com/forum/topic19169.html
(FF doesn't have to be the active window)
-> UrlDownloadtoFile or UrlDownloadtoVar (function search forum)

b) or perhaps use a Bookmarklet: https://www.squarefree.com/bookmarklets/webdevel.html
_________________
Tut 4 Newbies
TF : Text file & string lib, TF Forum
Back to top
View user's profile Send private message Visit poster's website
silkcom



Joined: 23 Jan 2008
Posts: 154

PostPosted: Tue Oct 28, 2008 5:27 pm    Post subject: Reply with quote

is there a way to read in the html that's there without redownloading the file? It would also be nice to be able to pull in image files that are already there without redownloading them (but not as necisary).
Back to top
View user's profile Send private message
John W



Joined: 09 Apr 2007
Posts: 172

PostPosted: Tue Oct 28, 2008 5:38 pm    Post subject: Reply with quote

There should be a hotkey in FF to view the source.
Try this: Send the Hotkey, mark everything, save clipboard, copy to clipboard, read from clipboard, restore clipboard, use the html source.
Code:
oldClip:=ClipboardAll
SendInput, <viewsource>^a^c
ClipWait, 3000
HTML=%Clipboard%
Clipboard:=oldClip

_________________
COMPLETELY INACTIVE - I do not use AHK anymore.
Back to top
View user's profile Send private message Send e-mail
silkcom



Joined: 23 Jan 2008
Posts: 154

PostPosted: Tue Oct 28, 2008 5:42 pm    Post subject: Reply with quote

hmm, i'd prefer to do this in the background. Basically there's a site that changes semi regularly, and i only want to know about it when it changes, otherwise it can sit in the background. There are several things I want to know about it, so the source is my best bet in rummaging through and creating logs etc.
Back to top
View user's profile Send private message
hugov



Joined: 27 May 2007
Posts: 2448

PostPosted: Tue Oct 28, 2008 5:51 pm    Post subject: Reply with quote

I use Update Scanner 2.2.3
https://addons.mozilla.org/en-US/firefox/addon/3362
you can configure it to check every minute hour day week etc.
_________________
Tut 4 Newbies
TF : Text file & string lib, TF Forum
Back to top
View user's profile Send private message Visit poster's website
silkcom



Joined: 23 Jan 2008
Posts: 154

PostPosted: Tue Oct 28, 2008 6:01 pm    Post subject: Reply with quote

Smile sorry to be a pain, however, the site is constantly changing. Every minute something changes. There are only a few changes that I want to know about. There are things that I wish to log, but those should be done in the background. But this update scanner is very similar to what i want to do.
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 154

PostPosted: Tue Oct 28, 2008 10:20 pm    Post subject: Reply with quote

Is it even possible to grab the HTML code from the current FireFox (really any browser would work) window? I know it has the HTML code, and I know that when you view source it doesn't go and regrab it. I'd be ok with a link to the DOM tree, anything that will let me parse through the page as it currently looks.
Back to top
View user's profile Send private message
tank



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

PostPosted: Wed Oct 29, 2008 2:00 am    Post subject: Reply with quote

silkcom wrote:
Is it even possible to grab the HTML code from the current FireFox (really any browser would work) window? I know it has the HTML code, and I know that when you view source it doesn't go and regrab it. I'd be ok with a link to the DOM tree, anything that will let me parse through the page as it currently looks.

firefox - No not with ahk
IE yes UrlDownloadToVar
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
tank



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

PostPosted: Wed Oct 29, 2008 2:54 am    Post subject: Reply with quote

Code:
hIESvr:=winexist("A")
    WinGetClass, class, ahk_id %hIESvr%
    if (!hIESvr or class != "Internet Explorer_Server")
   {
      MsgBox, Control "Internet Explorer_Server" not found.
      Return
      }
COM_CoInitialize()
WM_HTML_GETOBJECT := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT")
    SendMessage, WM_HTML_GETOBJECT,,,, ahk_id %hIESvr%
    lResult := ErrorLevel
    DllCall("oleacc\ObjectFromLresult", "uint", lResult
        , "uint", COM_GUID4String(IID_IHTMLDocument2,"{332C4425-26CB-11D0-B483-00C04FD90119}")
        , "int", 0, "uint*", pDoc)
msgbox % htmlcode:=COM_Invoke(DocEle:=COM_Invoke(pDoc, "documentElement") ,"innerHTML" )
innerHTML )
COM_CoUninitialize()
exitapp
You will need the latest version of com and to call this while a page is active you can similarly use the htmlcode as a string to parse but i wonder why you would bother using ti as text instead of using DOM on it
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 154

PostPosted: Wed Oct 29, 2008 4:43 pm    Post subject: Reply with quote

How sure are you that it's not possible in firefox? I really would prefer firefox. All i need is simply to find the correct window (by address or title), and get the html into a string. I can work with it from there.

It would be just as good to get the dom into an object.
Back to top
View user's profile Send private message
tank



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

PostPosted: Wed Oct 29, 2008 6:21 pm    Post subject: Reply with quote

i am certain that all the top dogs on this forum have discussed and investigated this and all said the same thing
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
evan
Guest





PostPosted: Wed Oct 29, 2008 6:46 pm    Post subject: Reply with quote

whats wrong with redownloading the html?
even there are hundreds of images and videos inside the site
when u download the html down, all it is is just a TXT file showing many image/video links
Back to top
silkcom



Joined: 23 Jan 2008
Posts: 154

PostPosted: Wed Oct 29, 2008 7:04 pm    Post subject: Reply with quote

It's a site full of ajax. So i'm not sure that downloading the html file again would give me what is currently showing in firefox
Back to top
View user's profile Send private message
tank



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

PostPosted: Wed Oct 29, 2008 9:08 pm    Post subject: Reply with quote

pretty much garantee it wouldnt
Guess your going to have to use soemthing like iMacros or use IE for your automated html grabbing by the way the problem with firefox is with getting the HTML via AHK there is simply no way short of some problematic sending of ctrl f and ctrl to copy and get the text from the page but even that wouldnt get you the HTML
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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