473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Modify HTML data

Hi all,

Can anyone help me with this ?

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.

Thanks, for your time !
Swarna.

Nov 6 '05 #1
5 2074
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?
Nov 6 '05 #2

Swarna wrote:
Hi all,

Can anyone help me with this ?

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 I understand correctly you need something like PyMeld, ElementTree
or BeautifulSoup

Lorenzo

Nov 6 '05 #3

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.

Nov 6 '05 #4
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
Nov 6 '05 #5

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 !

Nov 6 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Franco Fellico' | last post by:
Hi. Suppose to have read and displayed (using PHP) a group of row of a DB table on a dinamyc table on a HTML/PHP page. The number of row displayed could be from 1 to n. Each row contains...
0
by: Chris McKeever | last post by:
I am trying to modify the Mailman Python code to stop mapping MIME-types and use the extension of the attachment instead. I am pretty much clueless as to what I need to do here, but I think I have...
0
by: karenmiddleol | last post by:
The following code works fine I can connect to a SQL database and list all the records in the Orders table onto a web page. Now our users want me to modify it so that each row displayed as a...
16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
3
by: muttu2244 | last post by:
hi everybody am trying to modify a particular string from a csv file. for ex say i have compName, ipAddr, MacAddr, Os sdfsdf , 129.122.12.34 , dsfiasdf, wsfdjhs
4
by: muttu2244 | last post by:
Hi everybody Am trying to read a csv file "temp.csv", which has the below info, compName macAddr ipAddr opSys
2
by: Khundeen | last post by:
Hi, I am trying to modify the primary key of a table. We need to add new field and make it part of the Primary key of the table. I thought I can use this SQL Statement. ALTER TABLE...
0
by: =?utf-8?q?C=C3=A9dric_Lucantis?= | last post by:
Le Wednesday 02 July 2008 14:05:39 Jim Brown, vous avez écrit : You can either do it by hand by splitting your string in chars and getting the bytes values with ord (described here: ...
0
by: JRough | last post by:
I have the following code at the end of a page that lists some query results. It starts in a form that asks the user for input, one of two template pages. One template is a form for user input if...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.