mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2003
Posts: 9
B
Burchov Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Oct 2003
Posts: 9
I want to get the html code from an IE window that is already open, but I can't use sockets. In order to get to the page I want the html from, you need to log in with username, pass and a number that is displayed in an image. So I want to manually log on, and then retrieve the html code from a page that opens after I logged in.

Tia

Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
nHTMLn.dll?


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Apr 2003
Posts: 85
K
Babel fish
Offline
Babel fish
K
Joined: Apr 2003
Posts: 85
lol nice code hehehe

I prefer $iif(khaled == $god,yes,no)


--

katsklaw
Rather experienced Admin
Rather experienced mIRC Scripter
Amateur C Coder
Joined: Oct 2003
Posts: 9
B
Burchov Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Oct 2003
Posts: 9
How does nHTMLn.dll allow me to get the code? All I can see is that you can do all sorts of things with browsers that you can open inside mirc, but not getting the code from an open IE window...

Joined: Sep 2003
Posts: 156
B
Vogon poet
Offline
Vogon poet
B
Joined: Sep 2003
Posts: 156
You should open a socket on which page you wanna connect and get source codes.
eg:
Code:
alias getsource sockopen sourcesock www.mirc.com 80
on *:sockopen:sourcesock: $iif(!$sockerr, sockwrite -n $sockname GET www.mirc.com)

on *:sockread:sourcesock: {
sockread %tmp~
$iif(!$window(@tmp),window -k0ez @tmp,echo @tmp %tmp~)
}

I don't know how to login manually but I am thinkin about a way to do like creating a cookie file..
you gotta find some data about sending password by using domain names like;
"sockwrite GET page.com/forums/yourname/password"
and some data about post method
and creating cookie for which uses post method..
and I don't know any way.. am not good in scripting..

Joined: Oct 2003
Posts: 9
B
Burchov Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Oct 2003
Posts: 9
The point is that the login can't be automated, because the site also needs a number to login, and that number is in an image which is different for every visit. That's why my original post said that I can't use sockets.

Joined: Feb 2003
Posts: 309
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
nhtmln.dll is a good solution.
If you DEADSET need the code; find out about COM Objects and InternetExplorer.Application ...

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
This alias returns the path to a temporary HTML file that is currently used by the active IE window. It works here, under Win98se with IE6.
  • alias source {
    ;
    ; Prepare the file name we'll look for
    ;
    var %page = $gettok($url,-1,47)
    var %page = $gettok(%page,1,35)
    var %page = $gettok(%page,1,63)
    var %page = $remove(%page,www.)
    if $count(%page,.) {
    var %page = $deltok(%page,-1,46)
    }
    var %page = %page $+ [*
    ;
    ; There might be multiple files with similar name
    ; so we'll take the file whose creation date is the latest
    ;
    window -h @o
    !.echo -q $findfile(c:\windows\temporary internet files\content.ie5\,%page,0,echo @o $file($1-).ctime $1-)
    filter -wwcute 1 32 @o @o
    var %return = $deltok($line(@o,1),1,32)
    close -@ @o
    return %return
    }
Open a page and type //echo -a $source

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Yea InternetExplorer.Application is a valid, usable COM object, but I'm not sure if it's capable of returning the source code if a viewed page.


Link Copied to Clipboard