Search code examples
javascriptimacros

Unable to scrape data from a live graph


I want to scrape information from this live graph on "www.signal-binary.com/en". I tried recording the event on iMacros. It records, but when i add "EXTRACT=TXT" to pull information it is not working.

this is the recorded bit:

VERSION BUILD=844 RECORDER=CR
URL GOTO=http://signal-binary.com/en/
TAG POS=1 TYPE=TEXT ATTR=TXT:1.07927<SP>WAIT

And here is the command i am using to scrape the data:

VERSION BUILD=844 RECORDER=CR
URL GOTO=http://signal-binary.com/en/
TAG POS=1 TYPE=TEXT ATTR=* EXTRACT=TXT

I have also modified the script and tried the following with no luck:

VERSION BUILD=844 RECORDER=CR
SET !ERRORIGNORE YES
TAG POS={{!LOOP}} TYPE=RECT ATTR=CLASS:rvalue EXTRACT=TXT
PROMPT {{!EXTRACT}}

Please look into the red highlighted box on the image attachment for understanding my query better.

Need to scrape the info inside the red highlighted box


Solution

  • Then perhaps the following way will be helpful to you:

    SEARCH SOURCE=REGEXP:"(\\d+\\.\\d+ WAIT)" EXTRACT=$1
    PROMPT {{!EXTRACT}}
    

    Why didn't you guess to add the wildcard * ?

    TAG POS=1 TYPE=TEXT ATTR=TXT:*WAIT EXTRACT=TXT