0
$\begingroup$

StartWebSession creates a websession which can be controlled with many commands to automate web stuff. It is limited -- what if one wants to include arguments to the web browser, or start web browsers other than Chrome or Firefox? Presumably, one could use StartProcess to initiate an arbitrary web browser with command line arguments, then create a WebSession from the resulting ProcessObject. Is there a way to obtain a WebSessionObject from a ProcessObject? If not, can one emulate the functionality provided by WebExecute and similar commands with ProcessConnection to automate web browsing even the the fullest extent?

$\endgroup$
2
  • $\begingroup$ You cannot do it like this and expect to create a WebSessionObject. You should instead build a wrapper around either wget or curl commands, or your whatever API you have to your browser, so you can issue commands via Mathematica functions. As you say, you could achieve this with a process, or you could drive it from a python script. But if you want to automate browsing you can do this much more simply from C#. There's also github.com/ariya/phantomjs which is decent, though if you need maintenance it's unfortunately no longer in active development. $\endgroup$ Commented Sep 16, 2020 at 12:49
  • 1
    $\begingroup$ ^ you could also drive selenium from Mathematica over python via ExternalEvaluate. It can start the browser with options e.g options = FirefoxOptions() options.add_argument("--headless") options.add_argument("-private") $\endgroup$ Commented Sep 16, 2020 at 13:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.