Sign in to follow this  
Followers 0
jeffblack

Find Source of active window

4 posts in this topic

Hi

I'm trying to find a way to get the source code from the active web browser window I know I can get it using 

ConsoleWrite(_INetGetSource('http://www.autoitscript.com'))

but I don't want to have to enter a url. just want to open the window and press my hotkey

Is this possible if so would someone please point me in the right direction

Share this post


Link to post
Share on other sites



Which browser are you using?  Here's a primitive/quick example that works on my machine with IE11 (tested with only 1 window open)

#include <Inet.au3>
$sURL = ControlGetText("[CLASS:IEFrame]","","Edit1")
If Not $sURL Then Exit
ConsoleWrite(_INetGetSource($sURL))

 

Share this post


Link to post
Share on other sites

This works for Firefox but could be adapted for any browser

Opt("WinTitleMatchMode", -2)
$hWnd = WinActivate("firefox")
ControlSend($hWnd, "", "", "^{F6}^c")  
Msgbox(0,"", ClipGet())

 

Share this post


Link to post
Share on other sites

I have a freeware written in AutoIt3 designed to make it a bit easier to snap up source code from selected text on a browser page.  I call it SourceSnap

 

Mainly the idea is to save source to a filename, or for small selections, add the selection to a snp file.  It is very simple.  Just meant to make things a bit easier than free handing it. :)

Like all freeware on my page it is free for you to use at your own risk.  Don't get paranoid if VirusTotal shows a few red flags.  I regularly download everything on my page using DownLoadThemAll and compare the md5 sums with the zip files I have stored locally.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0