Sign in to follow this  
Followers 0
dannyict

Open local html page

7 posts in this topic

I'am trying to open a local htmlpage but don't know how

I tried

ShellExecute("page.html")

and

Run("page.html")

and

Fileopen("page.html")

nothing seem to open the page, should work in Xp and Win7.

Any suggestions? Thanks

Share this post


Link to post
Share on other sites



The script should open the web page and allow your browser to read?

ShellExecute(@ScriptDir & "\page.html") ; Your page

http://www.autoitscript.com/autoit3/docs/functions/ShellExecute.htm

It should "capture" the text into a variable of the HTML page?

$File = FileOpen(@ScriptDir & "\page.html", 0)

If $File = -1 Then
    Exit
EndIf

While 1
    $FileRead = FileRead($File, 1)
    If @error = -1 Then ExitLoop
    MsgBox(0, "HTML page", $FileRead)
Wend

FileClose($File)

http://www.autoitscript.com/autoit3/docs/functions/FileRead.htm

You want to take a specific part of the HTML page? As with all content in Javascript, for example?

(?i)(?s).*<script type='text/javascript'>(.*)</script>

http://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm

http://www.autoitscript.com/autoit3/docs/functions/StringRegExpReplace.htm

It needs a native code?

Share this post


Link to post
Share on other sites

ShellExecute("iexplore.exe page.html")


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

Thanks for the quick reply's, got it working now :mellow:

I used

ShellExecute(@ScriptDir & "\page.html") ; Your page

Share this post


Link to post
Share on other sites

Does this help you?

Note i have given my example location and the html... you use yours :mellow:

#include <IE.au3>
$oIE = _IECreate ("c:\Temp\page.html")

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Share this post


Link to post
Share on other sites

Thanks for the quick reply's, got it working now :)

I used

ShellExecute(@ScriptDir & "\page.html") ; Your page

You made a really easy question. I think it's normal that you received almost instant response. :)

You're welcome :mellow:

Does this help you?

Note i have given my example location and the html... you use yours :)

#include <IE.au3>
$oIE = _IECreate ("c:\Temp\page.html")

Better ShellExecute()

Your script opens the HTML file with Internet Exploded Explorer. The mine with the default browser.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@Goodware:

I noticed your reply and the part that describes opening the HTML-Page to a variable. This code works if you have the html-file somewhere on your harddisk, if i get it right...

@All:

Is it also possible to read a HTML-page _directly_ from the web to a variable - without opening any browser via script or something? Like autoit captures the html stream and "captures" it to a variable or something?

My goal is to create a little script, that reads a cerain webpage like every 10 minutes and reads a certain number from the page, to see if the page was changed.

Would that be possible somehow, or do i need to use a browser in the script to open, read and refresh the page somehow? I`m wondering if the mentioned IE.au3 (class?) thing has that kind of functionality by any chance...?

Any suggestions are welcome. Thanks a lot!

Edited by Savant2k6

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