1

Hi I'm trying to build a bot for a website, This website prints a log on the console. I need to save it in a variable, but I only need the number inside the log. How do I do that? I brought the sample log below

Setting mine delay 1221299

Salvator3e
  • 31
  • 5
  • Not sure if i understand the question. If the website prints the log, can you just save it in a variable as string and then write the code to extract the numbers of the variable like here ?https://stackoverflow.com/questions/30607419/return-only-numbers-from-string/30607466 – fernando Nov 26 '21 at 19:13
  • Maybe this answers your question? https://stackoverflow.com/questions/19846078/how-to-read-from-chromes-console-in-javascript – fravolt Nov 26 '21 at 19:13
  • I suppose you have access to the code that prints the output. Simply store the message into a variable before you pass to the log function `const msg = "Hello folks"; console.log(msg);` – Hairi Nov 26 '21 at 19:13
  • console.log("data") .... const sample = "data" instead of wrapping your code with console.log just put it in a variable ....... – vahid ghadiri Nov 26 '21 at 20:27

0 Answers0