Using ActiveX to copy and paste from a website
显示 更早的评论
I'm trying to use the function from the this post: https://www.mathworks.com/matlabcentral/answers/92736-is-there-an-example-of-how-to-call-microsoft-internet-explorer-as-an-automation-server
function str=CopyPasteIE(url);
ha = actxserver('internetexplorer.application');
ha.Visible = 1;
Navigate(ha, url);
pause(3); % Pause to let the page load
ha.document.execCommand('selectall','','');
ha.document.execCommand('copy','','');
str=clipboard('paste');
end
When I use the function I get this Error:
No appropriate method, property, or field execCommand for class Interface.JScriptTypeInfo_JScript_Type_Info.
Error in CopyPasteIE (line 6)
ha.document.execCommand('selectall','','');
What needs to change so that this function will work? I still use MatLab R2014a if it makes any difference.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 ActiveX 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!