Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to search a for tag

22 views
Skip to first unread message

J Lee Hughes

unread,
Aug 30, 2012, 7:58:01 AM8/30/12
to
I have Html documents and I need to put all the information
I know the tab <body> </body> how to search the tabs and get the data

J Lee Hughes

J Lee Hughes

unread,
Sep 1, 2012, 11:34:17 PM9/1/12
to
so
example
http://www.zip-info.com/cgi-local/zipsrch.exe?zip=91001

get the

Mailing Name , State Code , ZIP Code
Altadena , CA , 91001


code
<table border=0 cellspacing=4 cellpadding=1>
<tr><th>Mailing<BR>Name</th><th>State<BR>Code</th><th>ZIP<BR>Code</th></tr><tr><td align=center>Altadena</font></td><td align=center>CA</font></td><td align=center>91001</font></td></tr></table>



Evertjan.

unread,
Sep 2, 2012, 3:36:57 PM9/2/12
to
Again you do not ask a question.

================================

Perhaps this is what you want:

var a = '<table border=0 cellspacing=4 cellpadding=1><tr><th>Mailing<BR>
Name</th><th>State<BR>Code</th><th>ZIP<BR>Code</th></tr><tr><td
align=center>Altadena</font></td><td align=center>CA</font></td><td
align=center>91001</font></td></tr></table>';

var resultArray = a.split(/<[^>]+>/);

var commaString = resultArray.join(',');

alert(commaString);

=============================

It would be better if we knew wat you wanted, the above is valid if you
have the code as a string variable.

It could also be that you want to want to retrieve the DOM content of the
browser.

btw, the code string above is technically invalid html
due to the spurious </font> tags without correponding <font> tags.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
0 new messages