Posts: 858
Threads: 196
Joined: Apr 2005
Is possible to convert html in txt using QM like this?
<HTML>
<BODY>
<DIV>This is a test.</DIV>
<DIV> </DIV><DIV align="left">
<TABLE border="1" cellspacing="1" width="50%">
<TR height="20">
<TD valign="middle">text1</TD>
<TD width="20%" height="20" valign="middle">text2</TD>
</TR>
<TR height="20">
<TD width="20%" height="20" valign="middle">text3</TD>
<TD width="20%" height="20" valign="middle">text4</TD>
</TR>
<TR height="20">
<TD width="20%" height="20" valign="middle">text5</TD>
<TD width="20%" height="20" valign="middle">text6</TD>
</TR>
</TABLE>
</DIV>
<DIV> </DIV>
<DIV>End.</DIV>
</BODY>
</HTML>
---->
Posts: 12,072
Threads: 140
Joined: Dec 2002
I don't know an easy way. Very difficult.
Posts: 858
Threads: 196
Joined: Apr 2005
Posts: 12,072
Threads: 140
Joined: Dec 2002
To run PHP in QM:
Executing PHP code in QM
Very old. I did not test now.
Posts: 858
Threads: 196
Joined: Apr 2005
I can't test too. Is possible to translate to QM language?
Posts: 12,072
Threads: 140
Joined: Dec 2002
Posts: 12,072
Threads: 140
Joined: Dec 2002
You can use Lynx.
Download and install:
http://invisible-island.net/lynx/#installers
I choose "Latest built with curses (color-style)".
Test with a URL or existing file:
Macro
Macro2533
;run "$program files$\Lynx - web browser\lynx.exe" "http://www.quickmacros.com" "" "*" 0x10000
out
str txt
str lynxDir="$program files$\Lynx - web browser"
str url="http://www.quickmacros.com"
RunConsole2 F"{lynxDir}\lynx.exe -dump -nolist {url}" txt lynxDir
out txt
;-nolist removes [link number] and link URLs
Test with HTML saved in a temp file:
Macro
Macro2534
out
str html=
;<HTML>
;<BODY>
;<DIV>This is a test.</DIV>
;<DIV> </DIV><DIV align="left">
;<TABLE border="1" cellspacing="1" width="50%">
;<TR height="20">
;<TD valign="middle">text1</TD>
;<TD width="20%" height="20" valign="middle">text2</TD>
;</TR>
;<TR height="20">
;<TD width="20%" height="20" valign="middle">text3</TD>
;<TD width="20%" height="20" valign="middle">text4</TD>
;</TR>
;<TR height="20">
;<TD width="20%" height="20" valign="middle">text5</TD>
;<TD width="20%" height="20" valign="middle">text6</TD>
;</TR>
;</TABLE>
;</DIV>
;<DIV> </DIV>
;<DIV>End.</DIV>
;</BODY>
;</HTML>
str txt
str lynxDir="$program files$\Lynx - web browser"
__TempFile tf.Init("htm" "" "" html)
RunConsole2 F"{lynxDir}\lynx.exe -dump -nomargins {tf}" txt lynxDir
out txt
There are many command line options etc, all documented there.
Posts: 858
Threads: 196
Joined: Apr 2005
Posts: 858
Threads: 196
Joined: Apr 2005
I tested:
http://www.paehl.com/open_source/?TextB ... extbrowser
Looks like magic...
Note: also transforms the tables.
It's a pity that there is no dll to use in QM...