6

This can not be done with WebExecute because opening files from the local file system is always handled with the operating system's file dialog. It would be a big security hole if a browser could open any file from your computer without your consent. And WebExecute only operates directly on a web browser (through a proxy binary), so it can not do that. ...


6

As of 12.3 (I haven't checked the earlier versions), there is an undocumented command ElementAttribute to extract attributes: session = StartWebSession[]; WebExecute["OpenPage" -> "https://wolfram.com"]; elements = WebExecute["LocateElements" -> "CSSSelector" -> "div > a.item-0"]; WebExecute[&...


5

After some spelunking into WebUnit`Private, I've found some helpful functions like get, fetch and attribute, that could be used to do exactly what I need: getAttribute[element_WebElementObject, attribute_String] := getAttribute[$CurrentWebSession, element, attribute] getAttribute[session_WebSessionObject, element_WebElementObject, attribute_String] := ...


4

I would probably do it like this. Start a new session: browser = StartWebSession[] Open the page in question: WebExecute[browser, "OpenPage" -> "https://trumpgolfcount.com/displayoutings"] Get the innerText of the table: tableText = WebExecute[browser, "JavascriptExecute" -> "return document.getElementById('table_id').innerText;"]; Import ...


4

After some web search, I found this solution using this interesting CSS Pseudo-class focus. StartWebSession["Chrome"] WebExecute["OpenPage" -> "www.google.com"] input = First@WebExecute["LocateElements" -> "CSSSelector" -> "input:focus"] WebExecute["TypeElement" -> {input,"Test"}]; Here is the reference post.


3

Alright, I got into contact with the support for the API, and the problem was resolved on their end. Apparently, it was an error in the routers' networking configuration.


3

Update I was wrong, the element can be selected using the CSSSelector expiration = WebExecute[session, "LocateElements" -> {"CSSSelector", "select.ng-pristine"}] The element needs to be located first. I don't think it can be done using {"CSSSelector", "select.ng-pristine"}. One way using XPath (which you can get using Chrome developer tools). ...


2

Wolfram Inc. changes this concept rather often but since some time the API are gathered into the Wolfram Alpha Pro product. The central page for product information is https://products.wolframalpha.com/api/. The learning path doing this is harder than coping with Wolfram Alpha Pro. You have to work rapidly with the Google Android API. The start is always on ...


1

Note that many websites will not let you have their plaintext easily, if at all. There are all sorts of wrappers around useful information. That's why search is a lucrative business. Having said that, if a string search is your problem and you are going with the plaintext route; try the following example (without going through any company's server as there ...


1

I just found an answer to my own question. I'm not sure it's a good answer since it would open a new browser. I would prefer to do it headlessly. session = StartWebSession[]; myLink = "https://ui.adsabs.harvard.edu/abs/arXiv:1609.05206/references"; WebExecute[session, "OpenPage" -> myLink]; Pause[3]; (*pause for 3 seconds to let JavaScript run*) ...


Only top voted, non community-wiki answers of a minimum length are eligible