我正在开发一个相当大的自动化应用程序,从各种状态数据库中抓取各种废弃的财产信息,以便找到特定的财产。我已经使用各种形式的自动化为大约 8 个州网站开发了搜索脚本。我更喜欢使用 ruby 的 Mechanize 库之类的东西来执行自动化,因为这是迄今为止我遇到的最稳定的方法。在某些情况下,我无法使用 Mechanize 自动进行抓取,而必须回退到 Watir 之类的东西(或者更具体地说,Watir 的分支 Vapir)。当源需要 javascript 进行搜索时,特别需要 Vapir,因为 Mechanize 只发出 HTTP 请求,不处理 JS 解释。
我的问题是 Vapir 自动化 Internet Explorer 实例。在某些情况下,经过长时间搜索(其中一些搜索是针对 4,000 多个搜索词的列表)后,IE 会锁定。我认为这是 OLE 引擎的问题。我收到的错误如下:
failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80004005 Unspecified error
我找不到任何解决此问题的方法。
我的问题是,是否有人知道锁定自动化 OLE 实例的任何解决方案或解决方法?要修复该错误,我必须手动终止所有 IE 进程并重新启动自动搜索。
据我所知,替代方案是通过后端(而不是 IE)中的 Vapir 自动化 Firefox,或者可能切换转向类似 PhantomJS 的内容。有人对这两个选项有意见吗?
I am developing a rather large automation application to scrape various abandoned property information from various state databases, in order to find specific properties. I have already developed search scripts for about 8 state websites, using various forms of automation. I prefer to use something like ruby's Mechanize library to perform the automation, because it is the most stable method I have come across so far. In some cases, I am unable to automate the scraping with Mechanize and must fall back to something like Watir (or, more specifically, the branch of Watir called Vapir). Vapir is needed specifically when a source requires javascript to be searched, since Mechanize only makes HTTP requests and does not deal with JS interpretation.
My problem is with Vapir automating an instance of Internet Explorer. In some cases, after prolonged searches (some of these searches are for lists of 4,000+ search terms), IE locks up. I assume it is an issue with the OLE engine. The error I receive is as follows:
failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80004005 Unspecified error
I cannot find anything to resolve this issue.
My question is if anyone knows of any solution or work-around to an automated OLE instance that locks up? To fix the error, I have to manually kill all of the IE processes and restart the automated search.
Alternatives that I am aware of are to automate Firefox through Vapir in the back-end (rather than IE), or possibly switch over to something like PhantomJS. Does anybody have an opinion on either of these options?
发布评论
评论(1)
您使用 Vapir 有什么原因吗?为什么不尝试 watir (驱动 Internet Explorer)或 watir-webdriver(驱动 Internet Explorer、Firefox、Chrome 和 Opera)宝石?
有关安装,请参阅 https://github.com/zeljkofilipin/watirbook/blob/主控/安装/windows.md
Is there a reason you are using Vapir? Why don't you try watir (drives Internet Explorer) or watir-webdriver (drives Internet Explorer, Firefox, Chrome and Opera) gems?
For installation see https://github.com/zeljkofilipin/watirbook/blob/master/installation/windows.md