5 Replies - 731 Views - Last Post: 16 June 2012 - 07:51 AM Rate Topic: -----

#1 enemykil3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 16-June 12

How i can read a singline line of HTML Code?

Posted 16 June 2012 - 03:56 AM

Hello i have problem with getting a single line text from html webpage

i have searched for it but when i try that code:


Private Shared Function GetTitle(html As String) As String
   Dim r As New Regex("<title.*?>")
   Dim Title_start As Integer = 0
   Dim Title_end As Integer = 0
   For Each m As Match In r.Matches(html)
      If m.Value.ToLower = "<title>" Then
         Title_start = m.Index + m.Length
         Exit For
      End If
   Next
   r = New Regex("</title.*?>")
   For Each m As Match In r.Matches(html)
      If m.Value.ToLower = "</title>" Then
         Title_end = m.Index - Title_start
         Exit For
      End If
   Next
   Dim title As String = html.Substring(Title_start, Title_end)
   Return title
End Function



Then it gives me a error: REXES IS NOT DEFINED

can someone help me with that or suggest something else?

also i am using Visual Studio 2010

Is This A Good Question/Topic? 0
  • +

Replies To: How i can read a singline line of HTML Code?

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: How i can read a singline line of HTML Code?

Posted 16 June 2012 - 06:49 AM

"rexes" doesn't appear in any of your code. So there isn't much we can do for you without the code that actually creates the error.

What does this error message mean?


Debugging tutorials:
Was This Post Helpful? 0
  • +
  • -

#3 enemykil3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 16-June 12

Re: How i can read a singline line of HTML Code?

Posted 16 June 2012 - 06:56 AM

Allright but i have searched tutorials from google wich will be helping but nothing.

As a Professional programmers like you can say how i can get a one certain line to read from WebBrowser?

as i use WebBrowser function is there any way to read certain line from WebBrowser to TextBox ?

Or some func with .NET features?

like i have to read a line:

<h1>Heading</h1>

<td>I need to read this line</rd> // < --- This one





Sorry for extremly bad language
Was This Post Helpful? 0
  • +
  • -

#4 enemykil3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 16-June 12

Re: How i can read a singline line of HTML Code?

Posted 16 June 2012 - 07:02 AM

as you know this is very annoying to use code like this and define all years..


            If (WebBrowser1.DocumentText.Contains("<td>1988</td>")) Then
                Label1.Text = "Year: 1988"
            End If
            If (WebBrowser1.DocumentText.Contains("<td>1989</td>")) Then
                Label1.Text = "Year: 1989"
            End If




Please can you suggest some better func or some system to do it faster like i dont need to write 1000 lines of code for year...
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: How i can read a singline line of HTML Code?

Posted 16 June 2012 - 07:17 AM

I'm not interested in designing your logic for you. Or collaborating on your project.

YOu said you have an error

Quote

Then it gives me a error: REXES IS NOT DEFINED
and I tried to help teach you how to find and fix and UNDERSTAND.

You don't seem interested in actually learning: Just in finding sources for copy/paste building of your application.

Seeing as you aren't actually interesting in learning how to debug your own code I think you should consider a different line of education/career to pursue. You can't spend your life asking others to debug your code for you.

<unsubscribing from this thread>
Was This Post Helpful? 0
  • +
  • -

#6 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,511
  • Joined: 16-March 11

Re: How i can read a singline line of HTML Code?

Posted 16 June 2012 - 07:51 AM

State your goal, the code you've tried, and the error you received.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1