Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: mini browser with python

Reply
Thread Tools

Re: mini browser with python

 
 
Hans Mulder
Guest
Posts: n/a
 
      12-06-2012
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


 
Reply With Quote
 
 
 
 
John Gordon
Guest
Posts: n/a
 
      12-06-2012
In <(E-Mail Removed)> inq1ltd <(E-Mail Removed)> 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
http://www.velocityreviews.com/forums/(E-Mail Removed) B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

 
Reply With Quote
 
 
 
 
Terry Reedy
Guest
Posts: n/a
 
      12-06-2012
On 12/6/2012 1:15 PM, inq1ltd wrote:
> On Thursday, December 06, 2012 05:19:38 PM John Gordon wrote:
>
> > In <(E-Mail Removed)> inq1ltd

> <(E-Mail Removed)> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: mini browser with python Hans Mulder Python 1 12-05-2012 09:41 PM
Re: mini browser with python Miki Tebeka Python 0 12-05-2012 09:13 PM
Re: mini browser with python David Hutto Python 0 12-05-2012 08:36 PM
Mini Dual Layers? Mini dl ScubaSteve7979@gmail.com DVD Video 0 10-25-2005 07:52 PM



Advertisments