Sign in to follow this  
Followers 0
gamerman2360

OpenHTML

7 posts in this topic

#1 ·  Posted (edited)

Func OpenHTML($html, $URL = "")
    If $URL Then
        $html = StringReplace($html, '<head>', '<head><base href="' & $URL & '" />', 1)
        If Not @extended Then $html = '<base href="' & $URL & '" />' & $html
    EndIf
    $oIE = ObjCreate("InternetExplorer.Application.1")
    With $oIE
        .visible = 1
        .navigate("about:blank")
        .document.write($html)
    EndWith
EndFunc
No more FileWrite(), Run(), FileDelete(). Requires beta.

Edited by gamerman2360

Share this post


Link to post
Share on other sites



Func OpenHTML($html)
    $oIE = ObjCreate("InternetExplorer.Application.1")
    With $oIE
        .visible = 1
        .navigate("about:blank")
        .document.write($html)
    EndWith
EndFunc
No more FileWrite(), Run(), FileDelete(). Requires beta.
nice, this is very useful and simple, thanks

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

Thank you, i've seen it al before?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Func OpenHTML($html)
    $oIE = ObjCreate("InternetExplorer.Application.1")
    With $oIE
        .visible = 1
        .navigate("about:blank")
        .document.write($html)
    EndWith
EndFunc
No more FileWrite(), Run(), FileDelete(). Requires beta.
I certainly don't want to discourage anyone from learning the DOM and all of it's details, but this is how the same is done with IE.au3:

#include <IE.au3>
$oIE = _IECreate()
_IEDocWriteHTML($oIE, $html)

Dale

Edit: typo

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

I certainly don't want to discourage anyone from learning the DOM and all of it's details, but this is how the same is done with IE.au3:

#include <IE.au3>
$oIE = _IECreate()
_IEDocWriteHTML($oIE, $html)

Dale

Edit: typo

Oh, yeah, thanks dale. but this could be used if the script didn't rely too much on IE.au3

Thanks


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

Hmm, Ebay used to have a nice basic HTML editor, now you have to put the tags in yourself, this could be used to do something similar...


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

Edited so you can set the base URL for relative links within the document.

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