Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Phrasing HTML by Style
08-07-2012, 04:58 AM #1
- Join Date
- Sep 2006
- Thanked 0 Times in 0 Posts
Phrasing HTML by Style
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:
<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>
Everything before the <span> with my specific style can be ignored. I want to find the first instance of <a href=""> after the </span>.
08-14-2012, 11:40 AM #2
- Join Date
- Aug 2012
- Odessa, Ukraine
- 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.