Best method for Website Automation?

后端 未结 5 653
离开以前
离开以前 2020-12-10 08:14

Let me rephrase the question...

Here\'s the scenario: As an insurance agent you are constantly working with multiple insurance websites. For each website I need to

5条回答
  •  清歌不尽
    2020-12-10 08:24

    Assuming that you are talking about filling and submitting a form or forms using a bot of some sort then scraping the response to display to the user.

    Use HttpWebRequest(?) to create a form post containing the relevant form fields and data from your model and submit the request. Retrieve and analyse the response, store any cookies as you will need to resubmit the cookie on the next request. Formulate the next request based on the results of the first request ( remembering to attach cookies as necessary ) and submit it. Retrieve the response and display or parse and display ( depending on what you are hoping to achieve ).

    You say this is not a client app - therefore I will assume a web app. The downside of this is that once you start proxying requests for the user, you will have to always proxy those requests as there is no way for you to transfer any session cookies from the target site to the user and there is no ( simple / easy / logical ) way for the user to log in to the target site and then transfer the cookie to you.

    Usually when trying to do this sort of integration, people will use some form of published API for interacting with the companies / systems in question as they are designed for the type of interactions that you are referring to.

提交回复
热议问题