Click here to Skip to main content
15,115,261 members
Please Sign up or sign in to vote.
3.00/5 (3 votes)
For my job I'm doing a bit of automation to do research on different property appraisers websites. For the most part this is going well, how ever there are a few sites(Columbia County Property Appraiser) that pop a javascript alert message.

I'd like to stop this from happening so that the search can be completed without waiting for me to interact. I know I could bypass this all with HttpWebRequests. But I need to be able to view the pages so I can get the information off them I need.

The function I need to disable is AlertOnLoad(). The rest of the JS is fine.
Posted
Comments
Manfred Rudolf Bihy 21-Nov-10 20:48pm
   
Sounds a little bit fishy. What's that with the automation part, if you need to be able to view the pages? If you want to use automation then go for HttpWebRequest, else you'll have to write your own web browser.

You are not going to be able to disable it, you can't disable the onload event. At most you can disable all JavaScript, not individual methods or events.

Besides it isn't automation if you have to physically view each page.
   
Comments
Dalek Dave 22-Nov-10 6:39am
   
Good Answer.
Well that blows. I was hoping to shut down that so I can bypass that and do the search. It's not true automation because you can't trust the search to get the right property every time. I'm not data mining, if that was the case I'd just use HttpRequests and data mine.

What I was hoping was that one of the events of the webbrowser fired before the internal page events begin to fire. If so it would allow modifications to the page before it begins to process the Javascript. I don't want to stop the onload, just modify it before it proceeds.

The only other possibility would be to setup a proxy and modify the page before it reaches the control. But that would be an even bigger pain.
   
Comments
Dalek Dave 22-Nov-10 6:39am
   
Some things are just inherent and cannot be achieved (or at least not without Major contrivances).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900