• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Excel question - importing data from a web app

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

    #11
    This looks useful for my purposes so may have a bash. Just need to separate entire file from above into lines. Only prob is not all website source is formatted with line breaks and some tags can have minor content so could be messy.

    Bored, if you want to mail content or give me url and tell me which bits you want to extract I can see if works with yours.
    Last edited by xoggoth; 14 January 2009, 11:04.
    bloggoth

    If everything isn't black and white, I say, 'Why the hell not?'
    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

    Comment


      #12
      Update, I decided not to bother and redid the spreadsheet in Mathematica as I would have to do that eventually anyway.

      Comment


        #13
        Originally posted by xoggoth View Post
        This looks useful for my purposes so may have a bash. Just need to separate entire file from above into lines. Only prob is not all website source is formatted with line breaks and some tags can have minor content so could be messy.

        Bored, if you want to mail content or give me url and tell me which bits you want to extract I can see if works with yours.
        If the page is well-formed XML (which includes XHTML) then the responseXML property of XHR will contain the document parsed into a DOM tree.

        If the response is not well-formed, it won't. In that case, you may be better off reverting to the webbrowser control, which will allow you to traverse the HTML DOM via the document property.

        Comment


          #14
          Excel question - importing data from a web app

          To import a table from a web page and put it into a spreadsheet file, there is an excellent script posted at http://www.biterscripting.com/SS_WebPageToCSV.html . It imports n'th table from a web page (a web page may have more than one table) and puts it in a .csv file (Comma separated values). The good thing is that it strips off html and other tags, formatting, etc. along the way. Also, it will handle nested tables. So you don't have to do anything extra.

          I use it all the time. To use, you can download biterscripting free at http://www.biterscripting.com . Install all the sample scripts including the WebPageToCSV script with the following command.

          Code:
          script "http://www.biterscripting.com/Download/SS_AllSamples.txt"
          Should complete pretty fast. Call the WebPageToCSV script as below.

          Code:
          script "SS_WebPageToCSV.txt" page("http://www.xxx.yyy/mmm.nnn") number(5)
          The above will import 5th table from page http://www.xxx.yyy/mmm.nnn .

          One thing, if you add more functionality to their sample scripts, please post your improved scripts for the rest of us. Thanks in advance.

          Jenni

          Comment

          Working...
          X