Results 1 to 2 of 2
  1. #1
    AndyMan is offline Member
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Default parsing out some data.. from an HTML response

    Hey folks,

    I am building a web map based upon GeoServer (A java Web Feature Server)

    I am able to query, and get response from my WFS but it sends me more than I want. Have a lookit.. all of that stuff is what comes back in the response.response.Text All I want is the "pic0081.jpg" at the very end of the response.responseText so I can use it for a variable value on my page..

    Any help would be welcome...
    Andy.

    <html>
    <head>
    <title>Geoserver GetFeatureInfo output</title>
    </head>
    <style type="text/css">
    table.featureInfo, table.featureInfo td, table.featureInfo th {
    border:1px solid #ddd;
    border-collapse:collapse;
    margin:0;
    padding:0;
    font-size: 90%;
    padding:.2em .1em;
    }
    table.featureInfo th {
    padding:.2em .2em;
    font-weight:bold;
    background:#eee;
    }

    table.featureInfo td{
    background:#fff;
    }
    table.featureInfo tr.odd td{
    background:#eee;
    }
    table.featureInfo caption{
    text-align:left;
    font-size:100%;
    font-weight:bold;
    text-transform:uppercase;
    padding:.2em .2em;
    }
    </style>
    <body>


    pic0081.jpg

    </body>

    </html>

  2. #2
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    4

    Default

    You can use indexOf to find the position of <body> and </body> in the document. Then you can subtract these and get everything between them, then remove whitespace to obtain the pic0081.jpg from the body.

Similar Threads

  1. HTML FILE parsing.
    By makpandian in forum New To Java
    Replies: 8
    Last Post: 11-02-2010, 03:00 PM
  2. html web page parsing/scraping
    By orchid in forum Advanced Java
    Replies: 3
    Last Post: 10-21-2010, 01:34 PM
  3. parsing and updating html file using JSP.
    By tskarthic in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-02-2009, 09:12 PM
  4. Parsing HTML
    By jaadu25 in forum Advanced Java
    Replies: 6
    Last Post: 07-20-2008, 06:51 PM
  5. jeditorpane help parsing html
    By asifsolkar in forum Advanced Java
    Replies: 4
    Last Post: 12-14-2007, 05:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •