From: luca72 on
hello
with webbrowser i open the html or php etc page, how i can save the
opened page with python?

Thanks

Luca
From: Mithrandir on
luca72 <lucaberto(a)libero.it> wrote in news:abfb7720-6132-4b7b-8084-
5c1a481647e8(a)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."
From: luca72 on
On 1 Lug, 10:16, Mithrandir <mithrandiragainw...(a)mailinator.com>
wrote:
> luca72 <lucabe...(a)libero.it> wrote in news:abfb7720-6132-4b7b-8084-
> 5c1a48164...(a)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
From: drygal on
On 1 July, 09:31, luca72 <lucabe...(a)libero.it> wrote:
> On 1 Lug, 10:16, Mithrandir <mithrandiragainw...(a)mailinator.com>
> wrote:
>
>
>
>
>
> > luca72 <lucabe...(a)libero.it> wrote in news:abfb7720-6132-4b7b-8084-
> > 5c1a48164...(a)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,
 | 
Pages: 1
Prev: executable builder
Next: Extract doc strings