I am trying to pull a value from a website using HTMLUnit and Xpath. I have successfully created the xpath to pull the value from the right location but I cannot get it to pull the dynamic web content. Instead it will continue to pull the value that is found when you pull the 'View web site source' up in the browser. I am completely unsure why it refuses to pull the dynamic data and am needing some help in this regard.
In short, I continue to get the value "Player 1" rather than the the randomly generated character name that appears on the screen.
This is my xpath:
DomText domRedFighter = page.getFirstByXPath("//div[@class='left']/span/text()");
This is what the xpath is pulling from:
<span id="p1name" class="redtext">Player 1</span><br/><br/>
This is what I want the xpath to pull from:
<span id="p1name" class="redtext">Insert Dynamic Name Here</span><br/><br/>
Any help will be welcome. :)