I am trying to use Java (JSoup) to scrape an ESPN Fantasy Baseball Team Page in order to get Roster information to create a more robust trade application that the base ESPN league cannot support. I would like to be able to obtain the player mugshot URLs to be included in my application, but I am unable to easily navigate to a page/div that houses this information. Here is what I've found thus far.
Batter Table
Tables contain lists of players with the following formatted anchor tag...
<a href="" class="flexpop" content="tabs#ppc" instance="_ppc" fpopheight="357px" fpopwidth="490px" tab="null" leagueid="00000" playerid="3452" teamid="6" seasonid="2016" cache="true">Eric Hosmer</a>
Note: I have changed my leagueid in the above sample
Player FlexPop
When the anchor tag is selected a new div is dynamically added to the page which contains the image link I am looking for. Below is the portion of the div that contains the information that I am looking for.
<img width="200" height="145" src="http://a.espncdn.com/combiner/i?img=/i/headshots/mlb/players/full/30993.png&w=200&h=145" border="0" alt="Eric Hosmer" onerror="this.src='http://g.espncdn.com/s/flblm/14//images/playerpop/design2/no-mugshot-7.png'">
You can see in the source link that the playerId from the image link [30993] does not match the playerId from the anchor tag above [3452].
Does anyone know if there is any link/correlation between the playerId in my fantasy league versus the overall ESPN playerId? I would like to try to solve this issue without using a testing web browser automator (eg. Selenium, HtmlUnit).