0
votes

I'm in a trouble trying to fix some problem.. I have a program with Webbrowser control inside it. It automates crawling process from some website. The problem is that I cannot fix webbrowser after recent website changes.

They have changed page navigation on website. And when I do actions MANUALLY in webbrowser (in my app) it doesn't go to the next/previous page on website. It does nothing... Whereas it works properly in IE 7/8/9 (only scripting errors thrown this time).

So does it mean that Webbrowser is not fully similar to IE??

I'm sorry for not showing source codes here, I think it wouldn't help here. Which way should I go to troubleshoot it? Why page navigation is not working in Webbrowser control?

I tried to simply put Webbrowser on a Window Form in new project and tried to navigate page 2/3/../10 in the website catalog, but it simply changes page number and doesn't navigate to it...

EDIT: Website doesn't work propely even if I do actions manually in webbrowser using mouse clicks.. but works in IE.

EDIT2: I might be not clear in my question. The problem is that I cannot use website even Manually with mouseclicks via my Webbrowser control in app. It changes page number after I click on it, but it doesn't navigate to that page. It stays silent. I'm sure that AllowNavigation property is true. It worked just yesterday and stopped after website changes today... Please tell me which way should I go to troubleshoot it.. I thought that Webbrowser control acts the same way as Internet Explorer.. Any help from you highly appreciated! Thanks

EDIT3: Strange thing... i just loaded Extended Webbrowser and navigated to that website. Page navigation panel doesn't work there also.. Is it a bug on their side or some type of guard from crawlers? What do you think? (http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx)

3
-1: I'm sorry you didn't include any code. - John Saunders
John, how can I check why webbrowser control acts differently with the same website than IE? - Jeffrey Rasmussen
It certainly has to do with the code you didn't post. - John Saunders
The webbrowser control does act differently than IE. I'm not sure how to control the behavior in the C# control, but natively you implement IDocHostUIHandler and other interfaces that the WebOC attempts to get in its host. By tweaking those, you can get it to behave the same way as IE (because that's how IE does it). See msdn.microsoft.com/en-us/library/bb544942(v=VS.85).aspx - i_am_jorf
@jeffamaphone: It behaves differently, depending on the other code you implement. That's why I want him to post his code. - John Saunders

3 Answers

0
votes

I'm sure this isn't the answer your want but using the webbrowser control to scrape websites is very painful to maintain.

Instead use the HttpWebRequest and HttpWebRepsonse objects to recreate the calls to the webserver.

You can use Fiddler (http://www.fiddler2.com/fiddler2) and your browser to record your web sessions and recreate them in code.

0
votes

You can setup your webbrowser control to disable a number of features including navigation.

I.e. to disable nav in the C# WebBrowser control:

webBrowser1.AllowNavigation = false;

I'd double check that you're not doing anything like this.

0
votes

I had the same issue with a certain web site that recently changed its format. It has to do with the version of IE used by the control.

Simply force the IE version used to the latest (in my case 9). Setting the appropriate registry item to 9999 for my application worked; see: Webbrowser control behaving different than IE