Author Topic: need help using regex after i scrape a localhost site  (Read 8913 times)

0 Members and 2 Guests are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: need help using regex after i scrape a localhost site
« Reply #15 on: July 14, 2015, 01:34:59 PM »
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

  • Contributor
  • ***
  • Posts: 54
  • Karma: 0
    • View Profile
Re: need help using regex after i scrape a localhost site
« Reply #16 on: July 14, 2015, 03:23:10 PM »
will do next time, looking into RoboBrowser to accomplish this. thanks again

2exclusive

  • Contributor
  • ***
  • Posts: 54
  • Karma: 0
    • View Profile
Re: need help using regex after i scrape a localhost site
« Reply #17 on: July 15, 2015, 05:07:21 PM »
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

Code: [Select]
<?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

  • Contributor
  • ***
  • Posts: 54
  • Karma: 0
    • View Profile
Re: need help using regex after i scrape a localhost site
« Reply #18 on: July 15, 2015, 05:11:02 PM »
nevermind i figured it out, it was to use {Match.1}   :bonk

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: need help using regex after i scrape a localhost site
« Reply #19 on: July 15, 2015, 05:29:46 PM »
 ::banana
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)