473,387 Members | 1,702 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,387 software developers and data experts.

question: how to clare the absolute url in a html file

is there any lib to help to clear the absolute url in a html file? for
example, 'http://www.sina.com/' should be clear ,but "/image/asd.gif"
should be reserved.

Mar 23 '06 #1
4 1075
dongdong wrote:
is there any lib to help to clear the absolute url in a html file? for
example, 'http://www.sina.com/' should be clear ,but "/image/asd.gif"
should be reserved.


Built-in string-manipulation is your friend:

"abcdef/ghi".replace("abcdef", "")
Diez
Mar 23 '06 #2
to Diez B. Roggisch :
no, I won't to use this way, its efficiency is very low as I need to
replace all the '<a href="http:.//....' tags into whitespace.
I think whether there is any lib's function to do this.

Mar 23 '06 #3
dongdong wrote:
to Diez B. Roggisch :
no, I won't to use this way, its efficiency is very low as I need to
replace all the '<a href="http:.//....' tags into whitespace.
I think whether there is any lib's function to do this.


Why do you think it is slow? It repelaces _all_ occurrences, in one sweep.
What do you expect to become faster?

Diez
Mar 23 '06 #4
Perhaps this is what he means:

re.sub("http://[^/]*/","/","http://palle.fi/wing/walla.htm")
'/wing/walla.htm'

Mar 23 '06 #5

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

Similar topics

4
by: Paul Rubin | last post by:
I have a file with contents like: Vegetable: spinach Fruit: banana Flower: Daisy Fruit: pear
3
by: lonelyplanet999 | last post by:
Hi, I'm a newbie to perl and is now studying about perl programming, I read some perl programming tutorials online (enter 'Perl tutorial' at google.com) and also find some sample perl scripts...
9
by: Stuart | last post by:
Hi All, I got a challenge to make the same APS/Script/Html run on different web roots. I can not use relative pathing in a lot of cases. We use lots of included files so depending on where that...
21
by: AES/newspost | last post by:
My understanding -- I'm not an expert -- is that on (some? many? all?) standard Internet servers a URL can point to a subdirectory name followed by a backslash, and that links to this URL will...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
12
by: Bishoy George | last post by:
I have a dataset called ds1 filled with 2 tables Employees and Customers from Northwind database. I have dropdownList called ddLastName with the following properties: ddLastName.DataSource =...
1
by: slinky | last post by:
I have a practice website (I'm a newbie) that I want to use the Northwind SQL Server sample database in. First, do I upload the database into my App_Data folder of my website? Also I have a...
2
by: Stef Mientki | last post by:
hello, I'm trying to convert the links in html pages to absolute links, these pages can either be webpages or files on local harddisk (winXP). Now I've struggling for a while, and this code...
1
by: Sallana | last post by:
Hello guys. My name is Lynne and I am currently trying to build a website for a game that I play online called Exodus. This is the page --> http://exodus.mudmagic.com Immediately you can...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.