QtWeb
Internet Browser
QtWeb off-line Knowledge Base

 

Command line scripting

Author Topic: Scripting  (Read 249 times)

mobileaccess
« on: February 07, 2009, 03:20:59 PM »

Hi

This is such a great project.

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
 
mobileaccess
« Reply #1 on: February 07, 2009, 06:26:50 PM »

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.
 
Alex
« Reply #2 on: February 14, 2009, 08:00:48 AM »

Thank you for the feedback and the suggestion.

Feature request was created, you can check the status here:

http://code.google.com/p/qtweb/issues/detail?id=46
 
Alex
« Reply #3 on: February 21, 2009, 09:55:22 AM »

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 ..

In your case:

    QtWeb.exe -dump "http://somewebsite.com/somewebpage.html"  C:\qtweb.cache
 
mobileaccess
« Reply #4 on: February 22, 2009, 01:44:56 PM »

AWESOME! 

I am using QtWeb more and more. 

It is the most impressive *small* graphical browser since the OffByOne browser a number of years ago, which, like the old NCSA Mosaic, was very reliable but became outdated and cannot handle today's web content. 

You can't do scripting with Google Chrome.  I feel it's safe to say they'll never give the user that flexibility.

Thank you again for doing this. 

I'm going to make some more suggestions for you to consider, in separate threads. 
 
freakazoid
« Reply #5 on: March 24, 2009, 11:42:23 AM »

Great little feature!

Don't know when I would need to use it though... but glad it's there Wink
I can think of one thing off the top of my head... command-line download manager!
 

Back to KB