Click here to Skip to main content
15,887,350 members
Home / Discussions / C#
   

C#

 
GeneralRe: WebMatrix-Following Pin
Bram van Kampen17-Feb-13 14:45
Bram van Kampen17-Feb-13 14:45 
GeneralRe: WebMatrix-Following Pin
N a v a n e e t h17-Feb-13 17:10
N a v a n e e t h17-Feb-13 17:10 
AnswerRe: WebMatrix-Following Pin
Dave Kreskowiak16-Feb-13 18:50
mveDave Kreskowiak16-Feb-13 18:50 
GeneralRe: WebMatrix-Following Pin
Bram van Kampen17-Feb-13 14:50
Bram van Kampen17-Feb-13 14:50 
QuestionWebMatrix Pin
Bram van Kampen16-Feb-13 14:26
Bram van Kampen16-Feb-13 14:26 
AnswerRe: WebMatrix Pin
N a v a n e e t h16-Feb-13 18:01
N a v a n e e t h16-Feb-13 18:01 
QuestionParsing a web page to get just the <p> inner text. Pin
David C# Hobbyist.16-Feb-13 6:49
professionalDavid C# Hobbyist.16-Feb-13 6:49 
AnswerRe: Parsing a web page to get just the <p> inner text. Pin
N a v a n e e t h16-Feb-13 18:32
N a v a n e e t h16-Feb-13 18:32 
What you have done is BAD. Ideal way to handle this is to use a HTML parser and traverse the DOM to get the text that you need. Look at HTML Agility[^] project.

If you are sure that you will always have a wellformed input, you could easily do this with regular expressions. Here is a working example.
public static List<string> GetAllParagraphValues(string input)
{
    List<string> values = new List<string>();
    Regex r = new Regex("<p[^>]*>(?<value>.*?)</p>", RegexOptions.IgnoreCase);
    foreach (Match match in r.Matches(input))
    {
        values.Add(match.Groups["value"].Value);
    }
    return values;
}

Best wishes,
Navaneeth

GeneralRe: Parsing a web page to get just the <p> inner text. Pin
David C# Hobbyist.17-Feb-13 1:40
professionalDavid C# Hobbyist.17-Feb-13 1:40 
GeneralRe: Parsing a web page to get just the <p> inner text. Pin
Richard MacCutchan17-Feb-13 2:43
mveRichard MacCutchan17-Feb-13 2:43 
Questionexample for using webrequest and webresopnse Pin
arashmousapour16-Feb-13 2:10
arashmousapour16-Feb-13 2:10 
QuestionRe: example for using webrequest and webresopnse Pin
Richard MacCutchan16-Feb-13 2:33
mveRichard MacCutchan16-Feb-13 2:33 
GeneralRe: example for using webrequest and webresopnse Pin
PIEBALDconsult16-Feb-13 5:57
mvePIEBALDconsult16-Feb-13 5:57 
QuestionError: No value given for one or more required parameters ? Pin
taibc16-Feb-13 1:18
taibc16-Feb-13 1:18 
AnswerRe: Error: No value given for one or more required parameters ? Pin
Eddy Vluggen16-Feb-13 1:37
professionalEddy Vluggen16-Feb-13 1:37 
GeneralRe: Error: No value given for one or more required parameters ? Pin
taibc16-Feb-13 1:55
taibc16-Feb-13 1:55 
GeneralRe: Error: No value given for one or more required parameters ? Pin
Eddy Vluggen16-Feb-13 2:05
professionalEddy Vluggen16-Feb-13 2:05 
GeneralRe: Error: No value given for one or more required parameters ? Pin
taibc16-Feb-13 3:59
taibc16-Feb-13 3:59 
AnswerRe: Error: No value given for one or more required parameters ? Pin
Abhinav S16-Feb-13 6:27
Abhinav S16-Feb-13 6:27 
GeneralRe: Error: No value given for one or more required parameters ? Pin
taibc16-Feb-13 14:47
taibc16-Feb-13 14:47 
GeneralRe: Error: No value given for one or more required parameters ? Pin
Abhinav S16-Feb-13 22:50
Abhinav S16-Feb-13 22:50 
QuestionC# not release processes Pin
classy_dog15-Feb-13 9:28
classy_dog15-Feb-13 9:28 
AnswerRe: C# not release processes Pin
Eddy Vluggen15-Feb-13 9:47
professionalEddy Vluggen15-Feb-13 9:47 
GeneralRe: C# not release processes Pin
classy_dog15-Feb-13 10:13
classy_dog15-Feb-13 10:13 
GeneralRe: C# not release processes Pin
Eddy Vluggen15-Feb-13 10:16
professionalEddy Vluggen15-Feb-13 10:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.