Latest Inquiries - Data Extraction Software

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory.

Submitted: 3/16/2017
Hi,

I get the following error from time to time when calling the scrapper in command line.

Here is the error message I get:


Extracting data with web browser collector.
...
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. 
    This is often an indication that other memory is corrupt.
at System.StubHelpers.InterfaceMarshaler.ConvertToManaged(
    IntPtr pUnk, IntPtr itfMT, IntPtr classMT, Int32 flags)
at System.Windows.Forms.UnsafeNativeMethods.IHTMLDocument2.GetLocation()
at System.Windows.Forms.WebBrowser.get_Document()
at WebRipperBrowser.RipBaseBrowser.get_DomDocument()
at WebRipperBrowser.RipBaseBrowser.GetDocument(WrWebFrame pFrameIndex)
at WebRipperBrowser.RipBaseBrowser.GetExactElement(String , String , WrWebFrame , Boolean ,
     WrParameterValues )
at WebRipperBrowser.RipBaseBrowser.PathExists(String , String , WrWebFrame , Boolean ,
     WrParameterValues )
at WebRipperBrowser.RipBaseBrowser.NavigateAjaxClick(
    IHTMLElement pElement, WrParameterValues pTempData, WrTemplate pTemplate, WrContent pWaitContent,
     String pPageAreaPath, Boolean pIsNoWaitOldContentGone)
at VisualWebRipper.Processor.WrBrowserAgent.navigateAjaxClick(
    IHTMLElement pElement, WrTemplate pTemplate, WrContent pWaitContent, WrPageAreaPath pPageAreaPath,
     Boolean pIsNoWaitOldContentGone, WrParameterValues pTempData)
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , WrTemplate ,
     WrPageAreaPath , String , Boolean , Int32& )
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, WrPageAreaPath pPageAreaPath, Int32& pPageNavigationIndex,
     Boolean pIsNewNavigationSet, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , WrTemplate ,
     WrTemplate , WrPageAreaPath , String , Int32 , Boolean , String )
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, WrPageAreaPath pPageAreaPath, Int32& pPageNavigationIndex,
     Boolean pIsNewNavigationSet, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath)
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , List`1 ,
     WrPageAreaPath , Int32 , List`1 , WrFormFieldGroups , WrTemplate , WrTemplate , String )
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , WrTemplate ,
     WrTemplate , WrPageAreaPath , String )
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, WrPageAreaPath pPageAreaPath, Int32& pPageNavigationIndex,
     Boolean pIsNewNavigationSet, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath)
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , List`1 ,
     WrPageAreaPath , Int32 , List`1 , WrFormFieldGroups , WrTemplate , WrTemplate , String )
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , WrTemplate ,
     WrTemplate , WrPageAreaPath , String )
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, WrPageAreaPath pPageAreaPath, Int32& pPageNavigationIndex,
     Boolean pIsNewNavigationSet, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath)
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , List`1 ,
     WrPageAreaPath , Int32 , List`1 , WrFormFieldGroups , WrTemplate , WrTemplate , String )
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , WrTemplate ,
     WrTemplate , WrPageAreaPath , String )
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, WrPageAreaPath pPageAreaPath, Int32& pPageNavigationIndex,
     Boolean pIsNewNavigationSet, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath)
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , List`1 ,
     WrPageAreaPath , Int32 , List`1 , WrFormFieldGroups , WrTemplate , WrTemplate , String )
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , WrTemplate ,
     WrTemplate , WrPageAreaPath , String )
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, WrPageAreaPath pPageAreaPath, Int32& pPageNavigationIndex,
     Boolean pIsNewNavigationSet, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath)
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , WrTemplate ,
     WrTemplate , WrPageAreaPath , String )
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, WrPageAreaPath pPageAreaPath, Int32& pPageNavigationIndex,
     Boolean pIsNewNavigationSet, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath)
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , List`1 ,
     WrPageAreaPath , Int32 , List`1 , WrFormFieldGroups , WrTemplate , WrTemplate , String )
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , List`1 ,
     WrPageAreaPath , Int32 , List`1 , WrFormFieldGroups , WrTemplate , WrTemplate , String )
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , List`1 ,
     WrPageAreaPath , Int32 , List`1 , WrFormFieldGroups , WrTemplate , WrTemplate , String )
at VisualWebRipper.Processor.WrBrowserAgent.(WrParameterValues , WrReturnParameters , WrTemplate ,
     WrTemplate , WrPageAreaPath , String )
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath, WrPageAreaPath pPageAreaPath, Int32& pPageNavigationIndex,
     Boolean pIsNewNavigationSet, String pRecursiveBackUrl)
at VisualWebRipper.Processor.WrBrowserAgent.processTemplate(
    WrParameterValues pTempData, WrReturnParameters pReturn, WrTemplate pTemplate, String pTemplateText,
     String pSiteMapPath)
at VisualWebRipper.Processor.WrBrowserAgent.ProcessProject()



This doesn't happen all the time. A reboot and everything gets back to normal. Then it comes back again.

Here is the command used in my batch file:

"C:\Program Files (x86)\Visual Web Ripper\RunProject.exe" 
    "C:\Users\MyUser\Documents\Visual Web Ripper\Projects\myproject.rip" -user "username" -pwd 
    "password"

Unfortunately this is make my scheduled task completly unreliable :(

I wonder if you have any idea why this is happening.

Thanks

Michael



http://support.visualwebripper.com/Support.aspx
Replied: 3/20/2017 12:24:51 AM

HI,

Can I have your agent file?

Best regards,


Replied: 4/3/2017 10:31:55 AM

OK. Thank you very much for coming back and letting us know.


Replied: 4/1/2017 3:13:23 PM
It seems it was due to the fact I was using the crawler in some parts of the project where I did set some "wait for element".
Making sure the webbrowser mode is used everywhere fixed the issue.
Sorry for the late reply, the error is now gone.
Thanks guys.