0

I want to be able to copy all text on a web url.

Here is an example of how to do it in Matlab on windows:

function str=CopyPasteIE(url);
    h = actxserver('internetexplorer.application');
    Navigate(h, url);
    pause(3); % Pause to let the page load
    h.document.execCommand('selectall', '', '');
    h.document.execCommand('copy', '', '');
    str = clipboard('paste');
end

I want to do the this in Linux on Matlab.

jdl
  • 6,151
  • 19
  • 83
  • 132
  • You can use a headless web browser like [PhantomJS](https://phantomjs.org) or [SlimerJS](https://slimerjs.org). Use the recommended methods in this [post](https://stackoverflow.com/questions/18453993/use-phantomjs-to-extract-html-and-text) to capture texts. – rahnema1 Apr 26 '21 at 03:15
  • 1
    Or you can always call a terminal-based browser like lynx or w3m via a system command and collect the output as a string. e.g. `[s,o] = system( 'w3m https://uk.finance.yahoo.com -dump' )` – Tasos Papastylianou Apr 26 '21 at 15:58

1 Answers1

0

no you can't do this in linux. also internetexplorer is not available on Linux.

to download a webpage, you use builtin function urlread() or webread(), no need to use the less robust way via selectall+ctrl+c/v

FangQ
  • 1,444
  • 10
  • 18