PDA

View Full Version : How to remove multiple hyperlinks from a html page?



danielng
11-21-2005, 10:33 AM
Hi...does any one know to remove a plain html page full of links at one go?

I'm trying to extract some data from a table but I don't want the hyper links, there are few hundred different links so I can't do a find and replace.

Thanks in advance.

r2d2
11-21-2005, 01:17 PM
You'll probably want to use a text editor that can use 'regular expressions'. That way you can just remove the '<a XXXXX>' and '</a>', so leaving the link text as normal text. I don't know of a free one for windows (there probably is one though).

Chris
11-21-2005, 01:20 PM
edit plus supports regular expressions and has a 30 day free evaluation period. Its what I use.

moonshield
11-21-2005, 03:55 PM
^ I second that. Edit Plus is an excellent piece of software.

eMEraLdwPn
11-21-2005, 04:53 PM
you could also write a little script to do it... shouldn't take more than 5 minutes if you know php

Sean
11-21-2005, 07:03 PM
Chris and Moonshield: Thanks for mentioning editplus, I just downloaded it and it's great. I wish I had known about it before, I really could've used it. heh

danielng
11-21-2005, 11:59 PM
Thank you so much everyone...But I dont really understand just yet... :confused:

So for example I have many different links like :

<a href="http://www.yahoo.com">Yahoo</a>

<a href="http://www.google.com">Google</a>

What do I key in the find and replace?

danielng
11-22-2005, 12:04 AM
I have another question about CSS

Is it possible to set a table with different background cell colours for alternate rows using CSS?

This is the current stylesheet for my table.


.stats {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
line-height: 15px;
color: #333333;
background-color: ##F5F5F5;
}

r2d2
11-22-2005, 12:42 AM
Have a google for something like 'regular expressions removing hyperlinks' - it should reveal something. or search for 'regular expressions guide' to find how to make your own little reg. exp.

Sean
11-22-2005, 01:32 AM
I have another question about CSS

Is it possible to set a table with different background cell colours for alternate rows using CSS?

This is the current stylesheet for my table.

http://www.w3.org/TR/css3-selectors/#structural-pseudos would be for that but you'd be much better off using php or javascript.

danielng
11-22-2005, 01:48 AM
Have a google for something like 'regular expressions removing hyperlinks' - it should reveal something. or search for 'regular expressions guide' to find how to make your own little reg. exp.


Got the regular expression thingy worked out.

I did a find and replace for <a href="http://[^"]+"> and all the links were removed in an instant.

Thanks...