News:

HOT TIP! In the command editor, you can ctrl-click and drag an item to create a copy of it.

Main Menu

need help using regex after i scrape a localhost site

Started by 2exclusive, July 13, 2015, 04:58:52 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jitterjames

Please place any code (including XML HTML etc.) in a code box.  Especially when it is very long.

You can't force scrape to use a "browser" but you can use RoboBrowser.

2exclusive

will do next time, looking into RoboBrowser to accomplish this. thanks again

2exclusive

ok so I finally made some progress here using Robo Browser an using RoboB.GetHTML to scrape for the temperature digits which worked. How do you use the Results.RegEx output for TTS to speak it.

i have osd.showText with parameter {LastResult} but its showing me the HTML output not the Results.RegEx output. hope this is clear 

see my xml

<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.5.2-->
<command id="1379" name="RoboB_test" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>RoboB.Select</cmdType>
    <params>
      <param>Ecobee</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Navigate</cmdType>
    <params>
      <param>https://www.ecobee.com/consumerportal/index.html#/thermostats</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Wait</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementByTag</cmdType>
    <params>
      <param>DIV</param>
      <param>21</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.GetHTML</cmdType>
    <params />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>&gt;(.*?)&lt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

2exclusive

nevermind i figured it out, it was to use {Match.1}   :bonk

nime5ter

TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)