That's a workable solution, but it could be somewhat simplified:
QA=$(sort -u ${InFile} | shuf -n 1) works as well.
Note that, if you wanted the likelihood of a URL being selected to be proportional the frequency of it's occurrence in the page, then the unique sort could be skipped and a
QA=$(shuf -n 1 ${InFile}) used.
Also, if you wanted to do it all in one line, this
QA=$(curl http://xxx.com | lynx -dump -listonly -nonumbers -stdin | sort -u | shuf -n 1) should do the trick.