- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在从网站提取某些数据。我必须对表中至少一百万行执行此任务。我正在使用 Excel VBA 连接 MySQL。
按照上述步骤一切正常。但是,如果我尝试对超过 10 行执行此操作,则会出现以下错误。
Automation error the remote procedure call failed and did not execute
我意识到这与 IE 的打开/关闭有关。在我的程序中,我有以下代码。
为了创建一个新的 IE 应用程序,我定义如下。
Set ie = New InternetExplorer
Set RegEx = New RegExp
Dim iedoc As Object
ie.Navigate "http://www.google.com/search?hl=en&q=" & FirstName & "+" & LastName &
"+linkedin&meta="
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
MyStr = ie.Document.body.innerText
Set RegMatch = RegEx.Execute(MyStr)
提取一位作者的数据后,我在最后得到了下面的代码。
ie.Quit
Set RegEx = Nothing
Set ie = Nothing
Dim strBatchName As String
strBatchName = "F:\command.bat"
Shell strBatchName
command.bat 具有以下代码。
taskkill.exe /F /IM iexplore.exe /T
如果我的表中的行数少于 10 行,它就可以正常工作。但是,对于更多行数,我确实收到上述错误。
最佳答案
我更倾向于使用同一个 ie 实例来获取所有作者数据,如下例所示循环遍历它们。另外,您的批处理文件对数据做了什么?我从未发现需要批处理文件来帮助执行 vba。您使用它们来编写文本文件吗?您也可以使用 VBA 来完成此任务。
Dim ie As Object, lastRowAuthors as long, i as long, strBatchName As String
lastRowAuthors = sheets("Authors").Cells(Rows.Count, 1).End(xlUp).row
Set ie = New InternetExplorer
for i = 1 to lastRowAuthors
ie.Navigate "http://www.google.com/search?hl=en&q=" & sheets("Authors").range("A" & i).value & "+" & sheets("Authors").range("B" & i).value &
"+linkedin&meta="
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
Set RegEx = New RegExp
MyStr = ie.Document.body.innerText
Set RegMatch = RegEx.Execute(MyStr)
'*****************************************************************
' Use your REGEX commands to extract data
'*****************************************************************
strBatchName = "F:\command.bat"
Shell strBatchName
next i
ie.Quit
Set RegEx = Nothing
Set ie = Nothing
end sub
关于regex - Excel VBA : Automation error- Remote procedure call failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17154865/
我正在尝试创建一个工作流程,使用 Instapaper 将 URL 列表转换为纯文本,然后将文本保存在我机器上的文本文档中。 到目前为止,我已经能够获取 URL 列表、转换它们并保存文本文档。问题是我
有没有办法自动执行这些步骤? 打开 LibreOffice ODT 更新 TOC 和其他字段(例如通过菜单工具|更新|全部更新) 保存并关闭文档 最佳答案 如果您使用的是 Windows,那么使用 A
在 Microsoft Power Automate 中,使用表达式 utcNow() 可以获得当前日期(和时间)。我正在尝试获取昨天的日期。我尝试了 dateadd(utcNow(), -1) 和类
我使用 Power Automate Desktop 创建了一个桌面流程。但我无法安排或让它自动运行。有什么办法吗? 我不希望使用云流和使用网关连接桌面流。我需要在我的台式机本身内自动运行桌面流程。有
列表开始为空。然后,如果满足特定条件,我想为循环中的每次迭代附加一个值。我在变量操作中没有看到附加选项。 最佳答案 您可以使用字符串分割来实现此目的,假设您知道一个永远不会出现在值列表中的分隔符。我使
我使用 Power Automate Desktop 创建了一个桌面流程。但我无法安排或让它自动运行。有什么办法吗? 我不希望使用云流和使用网关连接桌面流。我需要在我的台式机本身内自动运行桌面流程。有
我使用的是 Mac OS X 11.0.1 Big Sur 我使用 Automator 创建了一个“看我做”的 QuickAction。我已经保存了它(似乎默认保存在 ~/Library/Servic
我的问题的历史: 我正在研究 UI automator (2.1.3) 和 Espresso 测试 + 在简单的 Mac Air (2014) 上使用 android studio (3.0.1)。之
有人要求我将 Sharepoint 上的 Excel 在线电子表格中的数据提取到 Power BI 中以创建仪表板 - 没问题,对吧?好吧,“数据点”之一实际上是指示状态的单元格的填充颜色。我进行了一
在 Power Automate 中,我正在调用一个返回此 JSON 的 API: { "status":"200", "Suburbs":[ { "
更新到 Mojave 后,我无法再使用之前使用的 automator 服务,并出现以下警报。 在“安全与隐私”中,我已经选中了 AppleScript Editor。 您发现我的代码有任何问题吗?或者
我在 Windows 7 下使用 Powershell 4,并且我的 cmdlet 定义如下: Function Transfer-File { [CmdletBinding()]
我在 commands.js 中使用这个方法 Cypress.Commands.add( 'iframeLoaded', { prevSubject: 'element' }, ($iframe) =
我正在使用 UI Automation 插件来自动化和测试在 Java 窗口中包含 HTML 对象的应用程序。我已将 UIATable 识别并保存在我的对象存储库中,并且以下方法工作正常: MsgBo
在我的项目中,有一个叫做创建任务的东西。创建任务并关闭页面后,系统会提示我一个警报“您即将关闭此应用程序并保存所有更改......” 然后是 OK 和 Cancel。 使用 F12,我无法检测到警报和
我使用 Cmder 作为我的命令提示符/控制台。 我发现自己每天多次使用相同的命令。例如 git merge --no-ff my-long-branch-name 有什么方法可以将这些命令存储在快捷
我是 Applescript 的新手,目前无法访问提示窗口,要求输入密码。 我正在为我的日常使用应用程序创建一个启动器,我想自动化启动过程。 现在,我只启动了两个应用程序,VirtualHostX 和
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 5年前关闭。 Improve this qu
如何为具有常规安装程序的程序创建自动安装程序,其中包含以下问题: 安装目录, 接受许可, 在桌面上创建图标 等等... 假设我可以为每个我想单独安装的程序构建一个自动安装程序,或者我想将文件放在一个自
如何在预定时间运行我的苹果脚本。我希望它每 45 分钟运行一次,但我不知道该怎么做。我将我的苹果脚本保存为应用程序。我接下来该怎么做? 谢谢 (目前,我正在使用 on idle 函数,但有更好的方法吗
我是一名优秀的程序员,十分优秀!