Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: mini browser with python (http://www.velocityreviews.com/forums/t955182-re-mini-browser-with-python.html)

Hans Mulder 12-06-2012 12:52 AM

Re: mini browser with python
 
On 5/12/12 22:44:21, inq1ltd wrote:

> I can connect to and download a web page,
> html code, and save it to a file. If connected
> to the web, I can change the settings on KWrite
> to open the file and navigate the page,
> (just like a browser does).


> I want to view the html file without using a browser


> or KWrite as I do now.


> Customer wants a direct connect to a dedicated
> website. Their clients can be using any
> browser. This gives them a a direct connect to
> a dedicated website for a specific purpose.
> In other words I need a mini, simple browser;
> something I can build that will open, read and
> display a saved html or the connected url site.


How about:

import os.path, webbrowser

webbrowser.open("file://" + os.path.abspath(your_file))

> I would appreciate some direction.


You'd get more useful answers if you'd give some
more context. For example:

* Which platform?
* Which version of Python?
* Which GUI (if any)?
* What capabilities do you need? CSS? Javascript?
* Are there any unusual requirement?


Hope this helps,

-- HansM



John Gordon 12-06-2012 05:19 PM

Re: mini browser with python
 
In <mailman.567.1354808057.29569.python-list@python.org> inq1ltd <inq1ltd@inqvista.com> writes:

> Right now I need some way to display
> 15 to 20 lines of html in its own window or
> as part of my screen.


Could you open a shell window and run a text web browser such as Lynx?

--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"


Terry Reedy 12-06-2012 08:15 PM

Re: mini browser with python
 
On 12/6/2012 1:15 PM, inq1ltd wrote:
> On Thursday, December 06, 2012 05:19:38 PM John Gordon wrote:
>
> > In <mailman.567.1354808057.29569.python-list@python.org> inq1ltd

> <inq1ltd@inqvista.com> writes:
> > > Right now I need some way to display
> > > 15 to 20 lines of html in its own window or
> > > as part of my screen.


> > Could you open a shell window and run a text web browser such as Lynx?


> That is a possibility but then every machine
> will have to have Lynx. That is not quite
> what the customer wants.


> Also, I can download the site to a file,


Or you can download and work with it in memory.

> convert the data to text,


Using existing html parser.

> then display it in a Text widget.


The complication in displaying html is with placing images and other
boxed content, including tables, and flowing text around the boxes. If
the html you want to work with is simple and has a somewhat fixed
format, you should be able to extract all the info as either text or a
table and be able to format and place it how you want.

--
Terry Jan Reedy



All times are GMT. The time now is 03:24 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57