Thursday, 8 August 2013

Having trouble reading HTML in Java

Having trouble reading HTML in Java

I'm a student who wants to have some fun during his summer vacation. There
is a website called www.saltybet.com , where a fighting game is played by
two AI's. Players can bet fake money on the outcome.
I want to make a piece of software in Java that stores every encountered
matchup of the game in a MySQL database, then places a bet based on
previous results. To do this, a first step would be reading the names of
the two AI players.
Now, when I highlight one of the character names (bottom right and bottom
left) in Firefox, and check the source of the website, it comes up as
this:
<div class="left">
<span id="p1name" class="redtext">Lobo</span><br><br>
<span class="field" id="player1wager">$2484343</span><br>
</div>
However, when I choose to view the entire page source, it comes up as this:
<div class="left">
<span id="p1name" class="redtext">Player
1</span><br/><br/>
<span class="field" id="player1wager">$0</span><br/>
</div>
Note that "Lobo" changed to "Player 1". Now, I know how to read a
website's HTML code into Java. However, I keep getting "Player 1" and
"Player 2" instead of the character names. Does anyone have an idea as to
how to get the correct player names out of the page source?

No comments:

Post a Comment