Announcement

Collapse
No announcement yet.

HTML to Image Script

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

    HTML to Image Script

    Hi, I use this HTML to Image script and I have to say it has been great. Currently I installed a solar system at my house and I would like to pull in some graphs and charts and make them available within HSTouch using this script. However there was nothing I could do to get it to capture the webpage

    Here is an example from the Settings.ini
    Code:
     
     
    [Capture2]
    URL=http://enlighten.enphaseenergy.com/systems/269788/graphs?range=today&view=energy_production
    ImagePath=TodayProduction.png
    Delay=300
    WBWidth=
    WBHeight=
    crop=
    [Capture3]
    URL=https://enlighten.enphaseenergy.com/systems/269788/graphs?range=last7Days&view=energy_production
    ImagePath=WeekProduction.png
    Delay=300
    WBWidth=
    WBHeight=
    crop=
    For the life of me I can't get this to capture anything. All I get is a weird sized white png file as if it never loads the page correctly.

    Any thoughts?

    #2
    There is a possibility that the graphs are created using something like Silverlight or Flash and the utility cannot capture them.

    If running Homeseer 2, take a look at my screen capture utility which may do what you want.
    Jon

    Comment


      #3
      Thanks for such a fast reply.

      I am using HSPro2. I will check out your screen capture utility for sure.

      The thing is though is that it doesn't capture anything (not just the graph is missing), so are you saying that perhaps the entire website is built on Silverlight or flash?

      Comment


        #4
        That worked perfectly. By chance do you know if there is there a way to open internet explorer at a certain window size via this script?

        Comment


          #5
          Originally posted by skarragallagher View Post
          Thanks for such a fast reply.

          I am using HSPro2. I will check out your screen capture utility for sure.

          The thing is though is that it doesn't capture anything (not just the graph is missing), so are you saying that perhaps the entire website is built on Silverlight or flash?
          Actually I see you need to login to view the pages. This may be one of the issues here.

          Originally posted by skarragallagher View Post
          That worked perfectly. By chance do you know if there is there a way to open internet explorer at a certain window size via this script?
          It is always set to full screen so that you get the maximum capture size. You just crop the area you need.
          Jon

          Comment


            #6
            Originally posted by jon00 View Post
            Actually I see you need to login to view the pages. This may be one of the issues here.



            It is always set to full screen so that you get the maximum capture size. You just crop the area you need.
            Got it. Yeah I think you are right. I am also having issues with the screen capture because of this. Even when I save my password in the browser if I close the session out it still prompts me for the password the first time.

            With Internet Explorer I have to start typing in the username field, then it comes up and I can click on the username from the drop down and then it will populate the password field at which point I click the login button and then it directs me to the page I want to capture

            From firefox it works a little better. The browser saving the password is prepopulated with no extra tryping or clicks, just by visiting the page. I tried using the Mouse Controls to just click the login button however (which works) however it doesn't wait for the page to load prior to taking the capture and it doesn't look like I can use two wait values.

            Also there may be issues running this when no console is connected (eg from an RDP session after I close out)

            You used to be able to enter the Username and Password in a URL however that no longer works

            Any thoughts on getting this to work reliably?

            Comment


              #7
              Actually I think I have it working reliably with firefox and some extra mouse movements.

              The first click actually clicks the button. The next 4 are just to kill time

              Code:
               
              MouseCtl=1226,430|0,300|0,1000|0,300,|0,1000

              Comment


                #8
                Now I just need to figure out how to get this to run properly even if I am not connected via RDP

                Code:
                11/11/2013 5:43:24 PM  Jon00_Capture2Image  Error in Main Subroutine Block 6 (Out of memory.)
                Last edited by skarragallagher; November 11, 2013, 08:57 PM.

                Comment


                  #9
                  I also get this.

                  Code:
                  11/11/2013 6:33:52 PM Jon00_Capture2Image Error in Main Subroutine Block 6 (The handle is invalid)

                  Comment


                    #10
                    Errors do happen with this one as the graphics are processed within Homeseer's memory space.
                    Jon

                    Comment


                      #11
                      Originally posted by jon00 View Post
                      Errors do happen with this one as the graphics are processed within Homeseer's memory space.
                      Unfortunately this happens every time when I am not connected via RDP. I have this set to run on my Homeseer server, but it is in an space that is easily accessible. So I regularly connect to it via RDP. When I am disconnected it doesn't work consistently every time. However when I have the RDP connection open it works like a champ

                      Comment


                        #12
                        hmm, not sure. Maybe something to do with the RDP graphic hook during the capture using less memory.
                        Jon

                        Comment


                          #13
                          Hi Jon00,

                          I was hoping you could help me with this. I reverted to using the HTML2Image script since I was unable to get the screen capture one working in an unattended mode.

                          I have since converted all of my graphing data over to a different website called pvoutput.org. This website is free and public and doesn't require any login. They appear to use Highcharts which all but one view (the most important one of course) I am able to capture. I can successfully capture the Live, Weekly, Monthly and Yearly however I cannot capture the "Daily"

                          The difference is with this one is that it appears that the graph load is animated which takes about an extra 2 seconds to load. It doesn't appear that the "delay" setting in the settings.ini has any affect with allowing the page to load fully (it does take longer for everything to run though). No matter what value I set for the delay it will only capture the chart just as it is beginning to draw leaving me with an image of a half drawn or 1/4 rendered chart

                          Here is an example of the settings I am using for the partially loaded chart:
                          Code:
                           
                          [Capture6]
                          URL=http://pvoutput.org/list.jsp?p=0&id=27112&sid=24805&gs=0&v=3&s=1
                          ImagePath=DailyProduction.png
                          Delay=400
                          WBWidth=1000
                          WBHeight=
                          crop=10,120,960,505
                          This one works fine:
                          Code:
                          [Capture5]
                          URL=http://pvoutput.org/aggregate.jsp?id=27112&sid=24805&v=0&t=y
                          ImagePath=YearProduction.png
                          Delay=200
                          WBWidth=1000
                          WBHeight=
                          crop=10,120,960,505
                          Is there any adjustment (like an additional wait state) that could be made that would allow the page to fully load prior to taking the snap? I am not sure what all is going on under the hood but I thought if you had a free moment you could check into it.

                          Any help with this is greatly appreciated.

                          Thanks

                          Comment


                            #14
                            I'll try and take a look at this for you over the weekend.
                            Jon

                            Comment


                              #15
                              That's all I could ever ask! Thanks a million

                              Comment

                              Working...
                              X