Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Read all occurances of a specific tag out of an HTML file

Read all occurances of a specific tag out of an HTML file

Scheduled Pinned Locked Moved C#
tutorialquestionhtml
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YiXiang_89
    wrote on last edited by
    #1

    Hi all How to use streamreader class to read all occurances of a specific tag out of an HTML file Example i want to read this tag << p >> onwards

    This is some text in a paragraph.

    How do i able to capture p ? Thank You

    N 1 Reply Last reply
    0
    • Y YiXiang_89

      Hi all How to use streamreader class to read all occurances of a specific tag out of an HTML file Example i want to read this tag << p >> onwards

      This is some text in a paragraph.

      How do i able to capture p ? Thank You

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Easy way is to read each character and check it is the expected one. If yes, start reading from there. Other way is to read the whole file and use regular expression to find <p>.

      Navaneeth How to use google | Ask smart questions

      Y 1 Reply Last reply
      0
      • N N a v a n e e t h

        Easy way is to read each character and check it is the expected one. If yes, start reading from there. Other way is to read the whole file and use regular expression to find <p>.

        Navaneeth How to use google | Ask smart questions

        Y Offline
        Y Offline
        YiXiang_89
        wrote on last edited by
        #3

        How to type out the code? =X Thank You

        N 1 Reply Last reply
        0
        • Y YiXiang_89

          How to type out the code? =X Thank You

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          What you mean? :confused:

          Navaneeth How to use google | Ask smart questions

          Y 1 Reply Last reply
          0
          • N N a v a n e e t h

            What you mean? :confused:

            Navaneeth How to use google | Ask smart questions

            Y Offline
            Y Offline
            YiXiang_89
            wrote on last edited by
            #5

            U say Easy way is to read each character and check it is the expected one. If yes, start reading from there. Other way is to read the whole file and use regular expression to find

            So what is the coding to check if it is the expected one? Thank You

            0 1 Reply Last reply
            0
            • Y YiXiang_89

              U say Easy way is to read each character and check it is the expected one. If yes, start reading from there. Other way is to read the whole file and use regular expression to find

              So what is the coding to check if it is the expected one? Thank You

              0 Offline
              0 Offline
              0x3c0
              wrote on last edited by
              #6

              You are highly unlikely to get a full code snippet. However, the regular expression you could try is along the lines of: [

              .*?

              ]{1,} I'm a little rusty on regexs, so this may have unexplained behaviour

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups