Use HttpWebResponse To Get Form Value
Hello,
Is it possible to get a form value from a website with HttpWebResponse?
This is the part of the form i would like to get:
<input type="hidden" name="xsrf.token" value="1358947513192.f4c8aaf7af1eab614fab23a38c5ee785"/>
The name is always the same, but the value changes every time the page is vised.
Is it possible to get the value to a string?
Greetings,
Jos Vink
Re: Use HttpWebResponse To Get Form Value
It depends what you want to do with it. You can download the content of the web page with the webclient or HttpWebRequest class and parse the results for it.
Re: Use HttpWebResponse To Get Form Value
Tnx for your response,
I just want the content of "Value" to a string.
Can you give me an example how to parse the result?
I have managed to download the content of the webpage with HttpWebRequest.
Greetings,
Jos Vink
Re: Use HttpWebResponse To Get Form Value
You can either use the Html Agility Pack which allows the document to be parsed and read.
Your other option is to use Regular Expressions to parse the response for what you need. You can use @"<input(.|\n)+?>" to start off with as the pattern. I'm really bad at RegEx so maybe someone else will be more help or you can find what you need from a google search.