AutoHotkey Community

It is currently May 26th, 2012, 11:08 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 45 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: October 28th, 2008, 5:04 pm 
Offline

Joined: January 23rd, 2008, 6:38 pm
Posts: 162
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 January 7th, 2009, 9:25 pm, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 5:18 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
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

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 5:27 pm 
Offline

Joined: January 23rd, 2008, 6:38 pm
Posts: 162
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).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 5:38 pm 
Offline

Joined: April 9th, 2007, 4:43 pm
Posts: 172
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 5:42 pm 
Offline

Joined: January 23rd, 2008, 6:38 pm
Posts: 162
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 5:51 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
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.

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 6:01 pm 
Offline

Joined: January 23rd, 2008, 6:38 pm
Posts: 162
:) 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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2008, 10:20 pm 
Offline

Joined: January 23rd, 2008, 6:38 pm
Posts: 162
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2008, 2:00 am 
Offline
User avatar

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

_________________
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: October 29th, 2008, 2:54 am 
Offline
User avatar

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

_________________
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: October 29th, 2008, 4:43 pm 
Offline

Joined: January 23rd, 2008, 6:38 pm
Posts: 162
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2008, 6:21 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
i am certain that all the top dogs on this forum have discussed and investigated this and all said the same thing

_________________
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: October 29th, 2008, 6:46 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2008, 7:04 pm 
Offline

Joined: January 23rd, 2008, 6:38 pm
Posts: 162
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2008, 9:08 pm 
Offline
User avatar

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

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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 60 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