Go to Url, Enter text, Click button

I am trying to create a program that will go to wolframalpha.com once a button is clicked, enter a text in the element id “i” (based on a text box), click a button with element id “equal” then copy the results that the website shows on a rich text box. None of these steps will be shown to the user (htmlviewer1 needs to be hidden). Can anyone tell me how to accomplish this? in very beginner steps…

PS. I’ve never coded in Xojo before, I do programming in windows (I can easily accomplish this on vb.net or c# using elementid and httprequest), first time on mac so I need very basic steps please.

Interesting web site.

[quote=83319:@James Defier]I am trying to create a program that will go to wolframalpha.com once a button is clicked, enter a text in the element id “i” (based on a text box), click a button with element id “equal” then copy the results that the website shows on a rich text box. None of these steps will be shown to the user (htmlviewer1 needs to be hidden). Can anyone tell me how to accomplish this? in very beginner steps…

PS. I’ve never coded in Xojo before, I do programming in windows (I can easily accomplish this on vb.net or c# using elementid and httprequest), first time on mac so I need very basic steps please.[/quote]

This might help you: https://forum.xojo.com/5714-html-source-code-as-a-string/p1#p75086

See https://forum.xojo.com/10694-web-robot

Keep in mind that a programmic click is not the same as a physical click on a browser, so it may not work anyway. Doesn’t wolfram have a REST API for this site anyway?

I checked the site. The click can be replaced by Return.

Perhaps, but you can’t simulate a physical key event either.

But you can send chr(13), right ?

You can, but that’s not the same. If you put a chr(13) into a text field, that’s what you get, a carriage return. Not a keyboard event.

Would this not work to create a key event:

https://forum.xojo.com/conversation/post/83411

or

https://forum.xojo.com/conversation/post/43185

I presume you need it for windows

No. That would create events on the server, not the browser.

Yes, there is an API.
http://products.wolframalpha.com/api/

You should use the API because content owners hate you if you scrape their website for data when they explicitly offer an API for it.
(it can be copyright infringement too.)

Always respect a content owners rights.

[quote=83533:@Tim Parnell]Yes, there is an API.
http://products.wolframalpha.com/api/

You should use the API because content owners hate you if you scrape their website for data when they explicitly offer an API for it.
(it can be copyright infringement too.)

Always respect a content owners rights.[/quote]

I am actually doing this for practice, trying it on couple websites, not just that one so the API will not be helpful. For example, I am also trying to accomplish the same thing on http://www.integral-calculator.com/, to make a simple portable integral calculator.

Would the enter button work on that website?

Would it in VB or C# you said you are more familiar with ?

Both. But I can write this in VB like right now. However, there are no converters online that will convert vb to mac compatible language… At the moment, I am trying to convert it to java, then use .jar file on mac… not sure if it will work

I have a class I developed for WolframAlpha which can retrieve text and/or images based on the query.

http://www.xojodevspot.com/demos/wolframalpha.zip

You will need to replace the API key with your own…