Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Html2text
#7
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
Code:
Copy      Help
;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
Code:
Copy      Help
out
str html=
;<HTML>
;<BODY>
;<DIV>This is a test.</DIV>
;<DIV>&nbsp;</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>&nbsp;</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.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)