Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Hoe do I read html from the web?

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hoe do I read html from the web?

    I want to write a program that allows user input, then returns a certain value based on that input. Let me illustrate:

    HTML Code:
    <tr class="dataSmall stripe"> 
    					<td> 
    					<a href="/finance/stocks/overview?symbol=PNX.N">PNX.N</a> 
    					</td> 
    					<td class="data">2.40</td> 
    					<td class="data changeUp">+0.86</td> 
    					 
    				</tr>
    Say the user input was PNX.N, and I wanted to return the value for the class "data changeUp", where would I even begin?

    How can I write a program that reads values from the html?
    Last edited by bholzer; August 9th, 2011 at 05:58 PM.


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: Hoe do I read html from the web?

    Is this Javascript? Then you need to find a Javascript forum.

    Is this Java? Then you need a html parser. Search the net.
    Improving the world one idiot at a time!

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Hoe do I read html from the web?

    If you need to change an HTML page, as junky said you need javascript (not java) - read the page via AJAX and update the html accordingly

Similar Threads

  1. [SOLVED] Read double from console without having to read a string and converting it to double.
    By Lord Voldemort in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: June 26th, 2011, 08:08 AM
  2. HTML Help Please!!!!!!
    By coolteenaaron in forum Other Programming Languages
    Replies: 1
    Last Post: May 25th, 2011, 04:28 PM
  3. HTML in JOptionPane
    By LordThumper in forum AWT / Java Swing
    Replies: 1
    Last Post: April 27th, 2011, 11:50 AM
  4. why does this code read an html file uncontinuously
    By nasi in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 25th, 2010, 09:09 PM
  5. Concatenating string with html tag
    By subhvi in forum Java Theory & Questions
    Replies: 4
    Last Post: September 29th, 2009, 05:47 AM