FAQ
hello
with webbrowser i open the html or php etc page, how i can save the
opened page with python?

Thanks

Luca

Search Discussions

  • Mithrandir at Jul 1, 2010 at 8:16 am
    luca72 <lucaberto at libero.it> wrote in news:abfb7720-6132-4b7b-8084-
    5c1a481647e8 at y11g2000yqm.googlegroups.com:
    hello
    with webbrowser i open the html or php etc page, how i can save the
    opened page with python?

    Thanks

    Luca
    Not sure of a way to capture info from a browser (like Firefox.) I know
    though that you can save the source of an page with:

    import urllib
    urllib.urlretrieve("http://www.example.com/", "Fun.html")

    You still need a web browser to read it formatted. (If you are on a web
    page in Firefox, and want to save it, click File>Save Page As...)

    If you want to save a picture from the Net see:

    http://www.daniweb.com/code/snippet216796.html

    Good luck!

    --
    People should read more.
    https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain
    "All that is gold does not glitter,
    not all those who wander are lost;
    the old that is strong does not wither,
    deep roots are not reached by the frost.
    From the ashes a fire shall be woken,
    a light from the shadows shall spring;
    renenwed shall be blade that was broken,
    the crownless again shall be king."
  • Luca72 at Jul 1, 2010 at 8:31 am

    On 1 Lug, 10:16, Mithrandir wrote:
    luca72 <lucabe... at libero.it> wrote in news:abfb7720-6132-4b7b-8084-
    5c1a48164... at y11g2000yqm.googlegroups.com:
    hello
    with webbrowser i open the html or php etc page, how i can save the
    opened page with python?
    Thanks
    Luca
    Not sure of a way to capture info from a browser (like Firefox.) I know
    though that you can save the source of an page with:

    import urllib
    urllib.urlretrieve("http://www.example.com/", "Fun.html")

    You still need a web browser to read it formatted. (If you are on a web
    page in Firefox, and want to save it, click File>Save Page As...)

    If you want to save a picture from the Net see:

    http://www.daniweb.com/code/snippet216796.html

    Good luck!

    --
    People should read more.https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain
    "All that is gold does not glitter,
    not all those who wander are lost;
    the old that is strong does not wither,
    deep roots are not reached by the frost.
    From the ashes a fire shall be woken,
    a light from the shadows shall spring;
    renenwed shall be blade that was broken,
    the crownless again shall be king."
    Thanks for your reply, the problem is that i don't want to save it
    with file-> save.
    there is any way to save the page by script.
    please note that when i save the page with firefox, it save the html
    page and also make a folder with the script used in the page, how i
    can make it also with python script?
    Thanks

    Luca
  • Drygal at Jul 1, 2010 at 12:55 pm

    On 1 July, 09:31, luca72 wrote:
    On 1 Lug, 10:16, Mithrandir wrote:




    luca72 <lucabe... at libero.it> wrote in news:abfb7720-6132-4b7b-8084-
    5c1a48164... at y11g2000yqm.googlegroups.com:
    hello
    with webbrowser i open the html or php etc page, how i can save the
    opened page with python?
    Thanks
    Luca
    Not sure of a way to capture info from a browser (like Firefox.) I know
    though that you can save the source of an page with:
    import urllib
    urllib.urlretrieve("http://www.example.com/", "Fun.html")
    You still need a web browser to read it formatted. (If you are on a web
    page in Firefox, and want to save it, click File>Save Page As...)
    If you want to save a picture from the Net see:
    http://www.daniweb.com/code/snippet216796.html
    Good luck!
    --
    People should read more.https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain
    "All that is gold does not glitter,
    not all those who wander are lost;
    the old that is strong does not wither,
    deep roots are not reached by the frost.
    From the ashes a fire shall be woken,
    a light from the shadows shall spring;
    renenwed shall be blade that was broken,
    the crownless again shall be king."
    Thanks for your reply, the problem is that i don't want to save it
    with file-> save.
    there is any way to save the page by script.
    please note that when i save the page with firefox, it save the html
    page and also make a folder with the script used in the page, how i
    can make it also with python script?
    Thanks

    Luca
    It is not quite possible. If python is used, it runs behind the scenes
    and generates html send to the browser. You could only see the .py
    file if the server was poorly configured so it would show the content
    of the .py file instead of actually executing it to generate the html
    code, but in that case you would not see any page either.

    Regards,

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJul 1, '10 at 7:50a
activeJul 1, '10 at 12:55p
posts4
users3
websitepython.org

3 users in discussion

Luca72: 2 posts Drygal: 1 post Mithrandir: 1 post

People

Translate

site design / logo © 2022 Grokbase