Interacting with a form on an external website
I am developing a program to automate some of the more repetitive tasks of my job. One of these tasks is to add some simple information to a form on a website that is run internally by the company for which I work, and then to submit that form. Unfortunately, this website does not have an API I can access, so I will need to use screen scraping techniques to achieve my goals.
I originally used the COM object SHDocVw to create a hidden browser object through which I could interact with the website.
dim ieBrowser as new SHDocVw.InternetExplorer
ieBrowser.navigate("www.website.com")
Do until ieBrowser.ReadyState = SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE
Loop
.
.
.
This works fine in my test environment, but when the site is published to the new server, the Do loop never completes. ReadyState remains READYSTATE_LOADING, and the page never resolves.
I have opened the security on the server as well as I know how, and if I type the web address in IE on the server, I can navigate without issue. I am looking for insight into what I may be missing, as well as other possible approaches (hopefully another object that is intrinsic to .net).
I realize that I can retrieve data from the website using System.Net.HTTPWebRequest, but I don't think I can fill in controls on the remote site, or submit the post with this object.
Any assistance is appreciated.
Thank you for your time.
Answers
Know the answer? Post it. Somebody with the same question will find it here.