문제

I am making a bot that simulates a human user using a specific website.

When the user uses the site here is what happens

  1. the user uploads a file by using the site's Browse button and then clicks Upload
  2. the server responds immediately and the user sees a Please Wait gif
  3. in the meantime the server is evaluating the file for errors. When it is done it redirects, and the user is take to a new .aspx page where they can correct the errors.

What I am not able to do w the bot is make it wait to get the redirect info.

The bot hits the website with this line of code (VB.NET)

Dim Response As HttpWebResponse = CType(Request.GetResponse(), HttpWebResponse)

The Response has the Please Wait gif in it, not the Errors.aspx page. Somehow I need to make the bot, execute that line of code above then, sorta listen to the same port(?) and wait for the web server to send another response.

Ideas?

도움이 되었습니까?

해결책

I ended up just sleeping the thread, then hitting the url again, repeatedly till I got the response I wanted.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top