-
Jan 23rd, 2013, 10:01 AM
#1
Thread Starter
New Member
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
-
Jan 23rd, 2013, 12:58 PM
#2
Hyperactive Member
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.
Last edited by wakawaka; Jan 23rd, 2013 at 02:24 PM.
-
Jan 24th, 2013, 01:53 AM
#3
Thread Starter
New Member
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
-
Jan 24th, 2013, 09:46 AM
#4
Hyperactive Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|