Re: mini browser with python

Discussion in 'Python' started by Hans Mulder, Dec 6, 2012.

  1. Hans Mulder

    Hans Mulder Guest

    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
    Hans Mulder, Dec 6, 2012
    #1
    1. Advertising

  2. Hans Mulder

    John Gordon Guest

    In <> inq1ltd <> 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
    B is for Basil, assaulted by bears
    -- Edward Gorey, "The Gashlycrumb Tinies"
    John Gordon, Dec 6, 2012
    #2
    1. Advertising

  3. Hans Mulder

    Terry Reedy Guest

    On 12/6/2012 1:15 PM, inq1ltd wrote:
    > On Thursday, December 06, 2012 05:19:38 PM John Gordon wrote:
    >
    > > In <> inq1ltd

    > <> 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
    Terry Reedy, Dec 6, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Hutto

    Re: mini browser with python

    David Hutto, Dec 5, 2012, in forum: Python
    Replies:
    0
    Views:
    130
    David Hutto
    Dec 5, 2012
  2. Miki Tebeka

    Re: mini browser with python

    Miki Tebeka, Dec 5, 2012, in forum: Python
    Replies:
    0
    Views:
    143
    Miki Tebeka
    Dec 5, 2012
  3. Hans Mulder

    Re: mini browser with python

    Hans Mulder, Dec 5, 2012, in forum: Python
    Replies:
    1
    Views:
    164
    Grant Edwards
    Dec 5, 2012
  4. Dave Angel

    Re: mini browser with python

    Dave Angel, Dec 5, 2012, in forum: Python
    Replies:
    0
    Views:
    166
    Dave Angel
    Dec 5, 2012
  5. John Gordon

    Re: mini browser with python

    John Gordon, Dec 5, 2012, in forum: Python
    Replies:
    0
    Views:
    151
    John Gordon
    Dec 5, 2012
Loading...

Share This Page