So the site that Im targeting works like this:
The sites name is https://masterbattlerite.com/. https://masterbattlerite.com/ works like this:
I found out of Selendroid but you need some sort of server to be able to emulate a browser? My app will be released on the play store so I don't want my users needing to start their own selendroid server everytime to do this (maybe Im wrong)
In your code, can you use an HTTP library/framework and POST to the same location the site posts to and retrieve the id from the redirect the server sends? You may have to set some extra (possibly hidden on the webpage) parameters to get it to work.
EDIT: ok, it's even easier with the site you mentioned... if you search for a username of bob, you just GET this URL: http://masterbattlerite.com/profile/bob/lookup and it returns some nice JSON with the id in it like so: {"status":"success","player":{"id":1268,"user_id":"5688","name":"bob","title":504,"avatar":30016}}
BTW - I figured all of this out using the Chrome developer's tools. Learn to use it - it is your friend.