Need help with applescript and wolfram alpha interface
Use the section's name to click on the "Copyable plaintext" button :  


first section = pod_0100, second section = pod_0200,  third
   section = pod_0300


Use the button's index : 


('action subpod-copyablept ')[0] = the first "Copyable plaintext" button in a section.
('action subpod-copyablept ')[1] = the second "Copyable plaintext" button in a section.


The answer of the popup window is appended to the end of the document.

EX ( query : "how many tablespoons in an ounce"):


if the script click on the first Copyable button in 'pod_0200' section, the
script return "2 tbsp  (tablespoons)"
if the script click on the first Copyable button in 'pod_0100' section, the
script return "convert 1 fl oz  (fluid ounce) to tablespoons"


--

if (button_pressed is buttonResearch) and (text_returned is not "") then
    set theUrl to "http://www.wolframalpha.com/input/?i=" &amp; encode_text(text_returned, true, false)
    tell application "Safari"
        tell window 1 to set current tab to (make new tab with properties {URL:theUrl})
        tell me to say "let me look that up for you now"
        tell document 1
            repeat -- wait until loaded
                delay 2
                if (do JavaScript "document.readyState") = "complete" then exit repeat
            end repeat
            do JavaScript "document.getElementById('pod_0200').getElementsByClassName('action subpod-copyablept ')[0].click()" -- show the popup window
            set theAnswer to do JavaScript "document.body.lastChild.getElementsByTagName('pre')[0].innerHTML;" -- get the answer in this popup window
        end tell
    end tell
    activate
    display dialog theAnswer
end if