Modify HTML data

Swarna swarnapsv at yahoo.co.in
Sun Nov 6 15:56:21 EST 2005


Peter Hansen wrote:
> Swarna wrote:
> > Peter Hansen wrote:
> >>Swarna wrote:
> >>>I am using scp in python to copy a html file on remote server, to my
> >>>local machine. Now, i need to update this html file in my local machine
> >>>( by adding a new Hyperlink to the existing table od hyperlinks ) and
> >>>copy it back (overwriting the old copy ) to the remote server.
> >>
> >>If you are using scp to copy the file from the remote server in the
> >>first place, what's stopping you from using scp to copy it back?
> >
> > I might be vague in expressing my problem.....the problem is not with
> > scp. What i need is how to modify the html file in my local machine
> > that i got from remote server.
>
> Ah, so all that stuff about scp was just to distract us from the real
> problem? <wink>
>
> Okay, so Lorenzo's advice is fine: grab an HTML parser and use that to
> figure out where things are.  Or if the problem is defined simply
> enough, you could use a regular expression (re module).  BeautifulSoup
> is often recommended when the HTML is not necessarily very clean...
>
> Personally, I'd start with an re and move on from there only if that was
> for some reason not sufficient.
>
> -Peter

  hey........i got it worked with simple file object.....Thanks, for
all your suggestions !




More information about the Python-list mailing list