Extracting a Price from an exchange using storetext

Hi I am trying to save a price from an exchange website it is a dynamic price that updates every few seconds. I tried storetext but get this “” I can see the number after the wording “resPricePerFromToken:” using java script inspector.

‘v2 [SWAP] rawBrief update {resAmount: 62.978488, resPricePerToToken: 0.01587843772940373, resPricePerFromToken: 62.97848799999999, priceImpact: 0.0023999999999999577, useSource: ‘dodoV2Wasm’, …} {fromToken: {…}, toToken: {…}, amount: ‘1000000000000000000’, slippage: 3, assetTo: ‘0xE36D4f3eCc9A48aEae8a0cC3E4216b3BB3f33d9c’, …}’

“Name”: “confirm”,
“CreationDate”: “2022-3-26”,
“Commands”: [
{
“Command”: “open”,
“Target”: “DODO - Decentralized Trading Protocol for Web3”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//[@id="root"]/div/div/main",
“Value”: “”,
“Targets”: [
"xpath=//
[@id="root"]/div/div/main”,
“xpath=//main”,
“css=#root > div.sc-hKwDye.bssaN.MuiBox-root > div > main”
],
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//[@id="root"]/div/div/main/div/div[2]/div[4]/div/form/div/input",
“Value”: “”,
“Targets”: [
"xpath=//
[@id="root"]/div/div/main/div/div[2]/div[4]/div/form/div/input”,
“xpath=//input[@value=‘’]”,
“xpath=//form/div/input”,
“css=#root > div.sc-hKwDye.bssaN.MuiBox-root > div > main > div > div.sc-hKwDye.ehEHVi.MuiBox-root > div:nth-child(4) > div > form > div > input”
],
“Description”: “”
},
{
“Command”: “type”,
“Target”: “xpath=//[@id="root"]/div/div/main/div/div[2]/div[4]/div/form/div/input",
“Value”: “1”,
“Targets”: [
"xpath=//
[@id="root"]/div/div/main/div/div[2]/div[4]/div/form/div/input”,
“xpath=//input[@value=‘1’]”,
“xpath=//form/div/input”,
“css=#root > div.sc-hKwDye.bssaN.MuiBox-root > div > main > div > div.sc-hKwDye.ehEHVi.MuiBox-root > div:nth-child(4) > div > form > div > input”
],
“Description”: “”
},
{
“Command”: “storeText”,
“Target”: “xpath=//*[@id="root"]/div/div/main/div/div[2]/div[5]/div/form/div/input”,
“Value”: “result”,
“Description”: “”
}
]
}

Link to photo. https://dev.ilien.io/wp-content/uploads/2022/03/Screenshot-2022-03-26-at-03.11.09.png New to this so sorry if its a simple fix

{
  "Name": "AA",
  "CreationDate": "2022-3-26",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://app.dodoex.io/?network=bsc-mainnet&from=BNB&to=USDT",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"root\"]/div/div/main/div/div[2]/div[4]/div/form/div/input",
      "Value": "300",
      "Description": ""
    },
    {
      "Command": "waitForElementNotPresent",
      "Target": "xpath=//input[@value='0']",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "waitForElementNotPresent",
      "Target": "xpath=//input[@value='-']",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "xpath=//*[@id=\"root\"]/div/div/main/div/div[2]/div[5]/div/form/div/input@value",
      "Value": "result",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${result}",
      "Value": "green",
      "Description": ""
    }
  ]
}

storeValue | xpath=(//input[@autocomplete=‘off’])[2] | result

{
“Command”: “storeValue”,
“Target”: " xpath=(//input[@autocomplete=‘off’])[2] ",
“Value”: “result”,
“Description”: “”
}
Tried above but got * [error][ignored]

Line 5: timeout reached when looking for element ‘xpath=(//input[@autocomplete=‘off’])[2] | result’

{
“Command”: “echo”,
“Target”: “${result}”,
“Value”: “green”,
“Description”: “”
} why is valur green here ?

I tried on the link and it works
(//input[@title=‘Token Amount’])[2] also works.

green means echo text will be in green color in “Logs”

go to inspect element and send screenshot of the element html

Thanks that worked but had other issues ((

Thanks for that. Got it to work but had other issues. So how can I extract the price here “resPricePerFromToken”:62.808896". the url is this https://route-api.dodoex.io/dodoapi/getdodoroute?fromTokenAddress=0xb49a312677ba1e80dde23c17e46e80b3e86b533d&fromTokenDecimals=18&toTokenAddress=0xe9e7cea3dedca5984780bafc599bd69add087d56&toTokenDecimals=18&fromAmount=1000000000000000000&slippage=3&userAddr=0x936B3b0836b9D3bf546D21Fd641705C5D8d7b4cA&chainId=56&deadLine=1648398739&source=dodoV2AndMixWasm&apiKey=d61f2eb1ce8d

any ideas

{
“Command”: “sourceExtract”,
“Target”: “resAmount”:*,",
“Value”: “Price”,
“Description”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “return ${Price}.replace('resAmount”:’,’’).replace(’,’,’’);",
“Value”: “Price”,
“Description”: “”
},
{
“Command”: “prompt”,
“Target”: “${Price}”,
“Value”: “”,
“Description”: “”
}

OR

{
“Command”: “executeScript”,
“Target”: “var x = document.getElementsByTagName(“BODY”)[0]\nreturn x.innerText.split('resAmount”:’)[1].split(’,’)[0];",
“Value”: “Price”,
“Description”: “”
},
{
“Command”: “prompt”,
“Target”: “${Price}”,
“Value”: “”,
“Description”: “”
}

forum editor changes quotes and double quotes

https://pastebin.com/tr0gUYLM

Thank for your input