Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    32
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Phrasing HTML by Style

    Hello,

    I am trying to do some HTML Phrasing. I have been trying various different things (xpath, mshtml, regex) to find something in my HTML document. But I am not having much luck. I am currently coding in VB and C#.

    What to know if there is a better method? If so what would an example look like?

    I am looking for the next instance of a hyperlink that follows after some text that has a inline style format. The html would look like this:

    Code:
    <p> Some Text <span style="color:black;background-color:gray">My Text</span> More Text</p><p>More Text <a href="">Item123</a> More Text </p>
    I want to return "Item123" from within the <a href=""></a>

    Everything before the <span> with my specific style can be ignored. I want to find the first instance of <a href=""> after the </span>.

    Thanks
    jlimited

  • #2
    New Coder
    Join Date
    Aug 2012
    Location
    Odessa, Ukraine
    Posts
    16
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Phrasing? Maybe, parsing?

    Try HtmlAgilityPack. It allows you to use xPath with HTML pages, which aren't really a well-formed XML document.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •