Announcement

Collapse
No announcement yet.

Issue w/ DataScraper

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Issue w/ DataScraper

    When trying to run the script I am getting these errors in my log
    PHP Code:

    Jun
    -02 5:56:32 PM         HSTouch Server Warning    Exception on Value Change callbackObject reference not set to an instance of an object.
    Jun-02 5:56:32 PM         HSTouch Server Warning    Exception on Value Change callbackObject reference not set to an instance of an object.
    Jun-02 5:56:32 PM         HSTouch Server Warning    Exception on Value Change callbackObject reference not set to an instance of an object.
    Jun-02 5:56:32 PM         HSTouch Server Warning    Exception on Value Change callbackObject reference not set to an instance of an object.
    Jun-02 5:56:32 PM         HSTouch Server Warning    Exception on Value Change callbackObject reference not set to an instance of an object.
    Jun-02 5:56:32 PM         Jon00_DataScrape    Virtual device created for Address Jon00-DS-001-5 with Reference40
    Jun
    -02 5:56:32 PM         Jon00_DataScrape    Virtual device created for Address Jon00-DS-001-4 with Reference39
    Jun
    -02 5:56:32 PM         Jon00_DataScrape    Virtual device created for Address Jon00-DS-001-3 with Reference38
    Jun
    -02 5:56:32 PM         Jon00_DataScrape    Virtual device created for Address Jon00-DS-001-2 with Reference37
    Jun
    -02 5:56:32 PM         Jon00_DataScrape    Virtual device created for Address Jon00-DS-001-1 with Reference36 
    Don

    #2
    The bottom 5 entries are just information statements that virtual devices have been created. You should only see those once.

    The top 5 entries are HSTouch errors. The device creation is standard code so must be a HS issue. Have you tried restarting HS?
    Jon

    Comment


      #3
      No, but I will.
      Don

      Comment


        #4
        Still Clueless

        I'm trying to scrape a simple HTML page and I just don't know what I am doing incorrectly.

        The source is
        PHP Code:
        Anytime Data Refill Rate</a></td>
            <
        td>10.0 GB</td
        I'm trying to extract 10.0 GB out of the above code using

        Pattern1=(?s)Anytime Data Refill Rate</a></td><td>(.*?)</td>

        My Device is defined as

        DeviceName1=Data Refill Rate
        DeviceText1=[0]
        DeviceValue1=
        DeviceImage1=
        Speakbutton1=1

        When I run the script it doesn't create the device nor the file Jon00DataScraperData.ini

        There are no error messages in the log.

        Can anyone point out where I'm going wrong?

        Thanks;
        Don

        Comment


          #5
          Don,

          Did you call the script with the correct parameters i.e.

          for [Grab2]

          Sub or function: Main
          Parameters: 2

          for [Grab 3]

          Sub or function: Main
          Parameters: 3

          If so and not working, set TextFile=1 and then run the script.

          Assuming you are using [Grab2], please post grab2.txt (in the Data\Jon00\Datascraper folder) here or via email. I'll take a look tomorrow for you.
          Jon

          Comment


            #6
            Dropped you an email with three files....
            Don

            Comment


              #7
              Don,

              Try:

              Pattern1=(?s)Anytime Data Allowance<.*?<td>(.*?)</td>
              DeviceName1=Data Refill Rate
              DeviceText1=[0]
              Last edited by jon00; June 6, 2015, 02:24 AM.
              Jon

              Comment


                #8
                Worked like a champ. Need to spend more time conceptually with this...

                Thanks!
                Don

                Comment


                  #9
                  Good stuff.

                  Remember, if you want to use the metric as a device value you can modify it as follows:

                  Pattern1=(?s)Anytime Data Allowance<.*?<td>(.*?) GB</td>
                  DeviceName1=Data Refill Rate
                  DeviceText1=[0] GB
                  DeviceValue1=[0]
                  Jon

                  Comment


                    #10
                    Thank you.
                    Don

                    Comment

                    Working...
                    X