WebRecorder/IEAuto get source from page
Moderators: JRL, Dorian (MJT support)
-
- Pro Scripter
- Posts: 110
- Joined: Thu Apr 08, 2010 6:11 am
- Location: Hørsholm, Denmark
- Contact:
WebRecorder/IEAuto get source from page
Hi,
Is it possible to get the source form the current loaded page?
I can get the source by rclicking and selecting View Source
then a notepad opens .. but it could be much cleaner if there somehow was another way.. ?
Is it possible to get the source form the current loaded page?
I can get the source by rclicking and selecting View Source
then a notepad opens .. but it could be much cleaner if there somehow was another way.. ?
Best Regards
Steen Jakobsen
DM Software A/S
Steen Jakobsen
DM Software A/S
- CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Couldn't You Use MS's function of HTTPRequest?
That Would Save The File To d:\mjtnet.html In Which You Could Then Read That File, Hence Giving You The Source Code?
Let Me Know If That Was What Your After?
Code: Select all
HTTPRequest>http://www.mjtnet.com,d:\mjtnet.html,GET,,HTMLResponse
ReadFile>d:\mjtnet.html,Data
MessageModal>%Data%
Let Me Know If That Was What Your After?
FIREFIGHTER
-
- Pro Scripter
- Posts: 110
- Joined: Thu Apr 08, 2010 6:11 am
- Location: Hørsholm, Denmark
- Contact:
- CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
-
- Pro Scripter
- Posts: 110
- Joined: Thu Apr 08, 2010 6:11 am
- Location: Hørsholm, Denmark
- Contact:
Hi again,
I just tried your example end it justv return the loginpage .. note page that is actually active..
However if i rclick the table on the page then I can export the complete source and then extract data from it.
The table i very complex and can not be extracted using webrecorder.
(Or I do not know how to..)
Thats why I'm after a way to gelt hold of the source - other than automating notepad
I just tried your example end it justv return the loginpage .. note page that is actually active..
However if i rclick the table on the page then I can export the complete source and then extract data from it.
The table i very complex and can not be extracted using webrecorder.
(Or I do not know how to..)
Thats why I'm after a way to gelt hold of the source - other than automating notepad

Best Regards
Steen Jakobsen
DM Software A/S
Steen Jakobsen
DM Software A/S
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
To get the HTML source of the page use the ExtractTag function for the HTML or BODY tag, specifying ALL html. Just remember to set the buffer size really high - if it's too low it may crash as it writes passed the end of the buffer:
Note the entire HTML for the BODY of the page is extracted. Specify HTML instead of BODY if you need the headers.
Now you have the BODY you could parse it with RegEx or whatever you want to do.
Code: Select all
// Generated by MacroScript WebRecorder 2.3
// Recorded on Friday, May 21, 2010, at 10:15 AM
LibLoad>IEAuto.dll,hIE
If>hIE=0
MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
Goto>end_script
EndIf
//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1
LibFunc>hIE,CreateIE,IE[2],0
LibFunc>hIE,Navigate,r,%IE[2]%,www.mjtnet.com
LibFunc>hIE,WaitIE,r,%IE[2]%
Wait>delay
//Modify buffer size if required ...
Let>BODYHTML_SIZE=99999999
LibFunc>hIE,ExtractTag,r,%IE[2]%,,BODY,0,1,BODYHTML
MidStr>r_6,1,r,BODYHTML
MessageModal>BODYHTML
LibFree>hIE
Label>end_script
Now you have the BODY you could parse it with RegEx or whatever you want to do.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 110
- Joined: Thu Apr 08, 2010 6:11 am
- Location: Hørsholm, Denmark
- Contact:
-
- Pro Scripter
- Posts: 110
- Joined: Thu Apr 08, 2010 6:11 am
- Location: Hørsholm, Denmark
- Contact:
Hi marcus,
It works fine some times.
However sometimes it give me this error
Error in : C:\DOCUME~l\AFDM\LOKALE~l\Temp\_debug.dbg
Line: 286 - Error Calling DLL - Possible wrong number or type of parameters.
It is the exact same code but just a bit further down in the script.
It seems that if LibFunc>hIE... has been called a couple of times then the error comes..
Any clue ?
It works fine some times.
However sometimes it give me this error
Error in : C:\DOCUME~l\AFDM\LOKALE~l\Temp\_debug.dbg
Line: 286 - Error Calling DLL - Possible wrong number or type of parameters.
It is the exact same code but just a bit further down in the script.
It seems that if LibFunc>hIE... has been called a couple of times then the error comes..
Any clue ?
Best Regards
Steen Jakobsen
DM Software A/S
Steen Jakobsen
DM Software A/S
-
- Pro Scripter
- Posts: 110
- Joined: Thu Apr 08, 2010 6:11 am
- Location: Hørsholm, Denmark
- Contact:
Hi Marcus,
I have worked it out .. and it WORKS GREAT now
The trick was to specify the frame and form arguments.
(Just liteh when clicking a BUTTON - se other post)
The the syntax error disapeared and the results were correct.
Mybe you shuld add a comment in the Doc's about it
Thanks for your help
I have worked it out .. and it WORKS GREAT now

The trick was to specify the frame and form arguments.
(Just liteh when clicking a BUTTON - se other post)
The the syntax error disapeared and the results were correct.
Mybe you shuld add a comment in the Doc's about it

Thanks for your help
Best Regards
Steen Jakobsen
DM Software A/S
Steen Jakobsen
DM Software A/S