WebExecute
allows to control a web browser through Mathematica. There are various actions one can perform programmatically through this function. However, I could not find the command to extract the website source text (the output you get by right-clicking on any website and selecting "View page source") with this function. Is it possible to obtain the page source of a website currently loaded by a web session in Mathematica 12.3? If so, which syntax can I use to do this?
As an example:
Let's say, we start a session and load a website:
session = StartWebSession[];
WebExecute["OpenPage" -> "https://www.wolfram.com"];
I would then like to get the page source, something like:
pageSource = GetPageSource[session];
Except, GetPageSource
is not a real command. What should I write instead of GetPageSource
?
Import[WebExecute[session, "PageURL"], "Source"]
? $\endgroup$