pbreda Posted October 30, 2009 at 11:36 AM Report Share #293997 Posted October 30, 2009 at 11:36 AM Boas, como é que recupero um ou mais tags meta sem que tenha um controlo de webbrowser? Cumprimentos.... Qualquer coisa esfrega a lampada!!!Visite Banco de Software e desfrute do software disponível xD Link to comment Share on other sites More sharing options...
Gooden Posted October 30, 2009 at 12:12 PM Report Share #294003 Posted October 30, 2009 at 12:12 PM Adiciona a referencia system.web e usas isto Web.HttpUtility.HtmlDecode("î") Link to comment Share on other sites More sharing options...
pbreda Posted October 30, 2009 at 12:41 PM Author Report Share #294017 Posted October 30, 2009 at 12:41 PM E agora faço o quê com isto? 😉 Qualquer coisa esfrega a lampada!!!Visite Banco de Software e desfrute do software disponível xD Link to comment Share on other sites More sharing options...
Gooden Posted October 30, 2009 at 12:43 PM Report Share #294018 Posted October 30, 2009 at 12:43 PM o que tu querias não era recuperar caracteres tipo ç etc... que tivessem em meta tags? então passas ai a frase e ele tira-te os meta tags e mete palavras certas Link to comment Share on other sites More sharing options...
pbreda Posted October 30, 2009 at 12:46 PM Author Report Share #294019 Posted October 30, 2009 at 12:46 PM Acho que me expliquei mal....peço desculpa.....o que quero é recuperar a descrição de um site....se que tem de ser pelos tags agora sem usar o webbrowser é que é mais complicado e queria saber isso.... Qualquer coisa esfrega a lampada!!!Visite Banco de Software e desfrute do software disponível xD Link to comment Share on other sites More sharing options...
Gooden Posted October 30, 2009 at 02:34 PM Report Share #294037 Posted October 30, 2009 at 02:34 PM Tas a falar daquelas tags exemplo %20%? Link to comment Share on other sites More sharing options...
pbreda Posted October 30, 2009 at 06:31 PM Author Report Share #294080 Posted October 30, 2009 at 06:31 PM Imagina que tens o site da google, este tem uma descrição que é colocada uma tag <Meta description="......> </Meta>.....bem o que quero é recuperar o valor do que está dentro da description sem usar o controlo webbrowser....ou seja....por HttpRequest acho que é isso..... Qualquer coisa esfrega a lampada!!!Visite Banco de Software e desfrute do software disponível xD Link to comment Share on other sites More sharing options...
Gooden Posted October 30, 2009 at 07:02 PM Report Share #294085 Posted October 30, 2009 at 07:02 PM AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH agora entendi xD tipo isto? Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim wb As New Net.WebClient Dim a As String a = wb.DownloadString("http://www.vbforums.com") Dim b() As String b = a.Split("<") Dim finalstring As New List(Of String) For i As Integer = 0 To b.Length - 1 If b(i).Length >= 4 Then If b(i).Substring(0, 4).ToLower = "meta" Then finalstring.Add(b(i)) End If End If Next For i As Integer = 0 To finalstring.Count - 1 If finalstring(i).ToLower.Contains("name=") Then MsgBox(Replace(midReturn("name=", " content=", finalstring(i)), """", "")) MsgBox(Replace(Replace(Replace(midReturn("content=", "", finalstring(i)), """", ""), "content=", ""), " />", "")) End If Next End Sub Public Function midReturn(ByVal first As String, ByVal last As String, ByVal total As String) As String Dim f_str As String = "" If last.Length < 1 Then f_str = total.Substring(total.IndexOf(first)) End If If first.Length < 1 Then f_str = total.Substring(0, (total.IndexOf(last))) End If Try f_str = ((total.Substring(total.IndexOf(first), (total.IndexOf(last) - total.IndexOf(first)))).Replace(first, "")).Replace(last, "") Catch ArgumentOutOfRangeException As Exception End Try midReturn = f_str End Function End Class Link to comment Share on other sites More sharing options...
pbreda Posted November 2, 2009 at 02:38 PM Author Report Share #294365 Posted November 2, 2009 at 02:38 PM Era mesmo isto que queria.....obrigado.... Qualquer coisa esfrega a lampada!!!Visite Banco de Software e desfrute do software disponível xD Link to comment Share on other sites More sharing options...
Gooden Posted November 2, 2009 at 03:34 PM Report Share #294375 Posted November 2, 2009 at 03:34 PM sem problemas 👍 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now