none
Web Manipulation.

    Question

  • Hey im trying to write a program that checks a website if a certain value is within a limit and if not enters a value into a text box and submits the information. I have researched into httpwebrequest however i cannot quite figure out how to progress from page to page. I also found that i can do browser manipulation however I don't a browser to be a open while the program is waiting for a specific value. So is there any way to do something like browser manipulation without the browser?

    Tuesday, January 10, 2012 3:53 AM

Answers

  • Hi Aasheesh,

    Welcome to the MSDN Forum.

    How about this tool: htmlagilitypack

    This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams).

    Now you can use this tool to parse your html string getting from httpwebrequest or else.

    And here is an example about this tool: http://htmlagilitypack.codeplex.com/wikipage?title=Examples

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, January 12, 2012 3:33 AM

All replies

  • Please paste your existing code so we can check and fix. Here is a good article on httpwebrequest class.

    http://support.microsoft.com/kb/301102

    Yes, you can perform submit operation without using a browser. For this you need to add a parameter with the URL of the web and then you can grab that parameter in web page.

     

    BTW, the website you are talking about is yours or any 3rd party website?


    If my post answers your question then mark as answer.
    Tuesday, January 10, 2012 4:10 AM
  • Hi Aasheesh,

    Welcome to the MSDN Forum.

    How about this tool: htmlagilitypack

    This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams).

    Now you can use this tool to parse your html string getting from httpwebrequest or else.

    And here is an example about this tool: http://htmlagilitypack.codeplex.com/wikipage?title=Examples

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, January 12, 2012 3:33 AM