seguinte
tenho o seguinte HTML:
<title>Meu site</title> <link rel="stylesheet" href="style.css"> <table width="275" border="0" cellspacing="3" cellpadding="4"> <tr> <td class="index1" width="120" nowrap>Espaço utilizado</td> <td class="index2">7.83 Megabytes</td> </tr> <tr> <td class="index1" width="120" nowrap>Nº de e-mails</td> <td class="index2">20 e-mails</td> </tr> </table>
eu gostaria de um code que pegasse o que tiver entre o <td></td> e colocasse numa tabela
ex:
$espaco = "7.83 Megabytes";
$email = "20 e-mails";
eu tentei o seguinte codigo
#!/usr/bin/perl print "Content-type: text/html\n\n"; open(BD,"teste.htm") || print("Arquivo não existe!"); while(<BD>){ if (/<td class=\"index1\" width=\"120\" nowrap>Espaço utilizado<\/td>/) {($esp) = $_ =~ /<td class=\"index1\" width=\"120\" nowrap>Espaço utilizado<\/td>(.*?)<\/td>/; } if (/<td class=\"index1\" width=\"120\" nowrap>Nº de e-mails<\/td>/) {($email) = $_ =~ /<td class=\"index1\" width=\"120\" nowrap>Nº de e-mails<\/td>(.*?)<\/td>/; } } close(DB); print "Usados: $esp"; print " <br>\n\n"; print "E-mail: $titulo";Mais nao funciona
alguem pode me ajudar???
flw
Edição feita por: Gabriel, 19/04/2005, 16:20.