Tallefer / qtweb

Automatically exported from code.google.com/p/qtweb
0 stars 0 forks source link

More support for command line Scripting is needed #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
... to dump the content of loaded web page to a file.

From user:

One of many things I like is the QtWeb exe handles URI's from the command 
line, even if they contain chars like commas, etc. when I enclose the URI 
in quotes.  

(Can Opera do this?  I don't think so!)

Is there a way I can dump the source to a file or pipe it? 

e.g. 

QtWeb "http://www.abcd/hjkl?ty=wer,z,c,b.aspx" > filename
or
QtWeb "http://www.abcd/hjkl?ty=wer,z,c,b.aspx" | otherprogram

-----

One can browse to the desired webpage, and 'View Source' and then save the 
source with Notepad.

or

If one enables the disk caching feature in QtWeb, then one can browse the 
desired webpages, and then get source from the cache dir. Here's a crude 
hack, using GNU UNIX utils:

grep -r text\/html QtWebCache\cache\http|gawk '{print 
$3}'|sed "s:\\:\/:g;s:^:strings :;s:$: >> qtweb\.cache:"

- find the html pages in the cache dir
- change the backslashes to forward slashes
- use strings.exe to dump the non-binary contents, i.e. page source, to a 
file called qtweb.cache

But imagine if one could dump source straight to qtweb.cache with QtWeb 
from the command line.

QtWeb.exe -dump http://somewebsite.com/somewebpage.html > qtweb.cache

QtWeb's usefulness would IMO become enormous. Harmful javascript could be 
easily monitored and even 'sterilised' to plain html, on the fly through 
simple text manipulation. Mobile users who require access to javascripted 
pages could gain access. Blind users could change pages to text, opening 
up more possibilities with text-to-speech technology, than with then 
current cumbersome screen readers.
These are just three main ways this would be useful. I can think of many 
others.

Consider that, with only a very few difficult, faulty and/or obscure 
exceptions, *no current browser* can dump a javascripted page from the 
command line.

QtWeb would be the first.

-----------------

to implement in next versions

Original issue reported on code.google.com by alexei.c...@gmail.com on 14 Feb 2009 at 3:59

GoogleCodeExporter commented 9 years ago
Dumping loaded web page is implemented in v.1.7 build 012

Use command line parameters:

    -dump http_full_url local_file_path

    -dump_and_quit "http full url" "local file path"

.. commas can be used if spaces are in URL/FilePath ..

Original comment by alexei.c...@gmail.com on 21 Feb 2009 at 5:52