Try the free iMacros Firefox addon. It has extensive web scraping support and since it works in the browser, it can handle Javascript. You can start it also via the command line.
Edit: This does indeed work. Here's a macro for downloading the past 3 days of sales reports. I haven't yet tried integrating with command line tools, but it should work.
VERSION BUILD=6650406 RECORDER=FX
TAB T=1
URL GOTO=https://itunesconnect.apple.com/
TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:appleConnectForm ATTR=NAME:1.Continue&&SRC:https://itunesconnect.apple.com/AppleConnect/US-EN/labelconnect/btn_signin.png
TAG POS=1 TYPE=B ATTR=TXT:Sales<SP>and<SP>Trends
TAG POS=1 TYPE=A ATTR=ID:theForm:saletestid
TAG POS=1 TYPE=SELECT FORM=NAME:theForm ATTR=ID:theForm:datePickerSourceSelectElementSales CONTENT=1
TAG POS=1 TYPE=A ATTR=ID:theForm:downloadLabel2
ONDOWNLOAD FOLDER=~/Downloads/iTCSales/ FILE=Daily-{{!NOW:yyyymmdd}}-1.txt.gz WAIT=YES
TAG POS=1 TYPE=SELECT FORM=NAME:theForm ATTR=ID:theForm:datePickerSourceSelectElementSales CONTENT=2
TAG POS=1 TYPE=A ATTR=ID:theForm:downloadLabel2
ONDOWNLOAD FOLDER=~/Downloads/iTCSales FILE=Daily-{{!NOW:yyyymmdd}}-2.txt.gz WAIT=YES
TAG POS=1 TYPE=SELECT FORM=NAME:theForm ATTR=ID:theForm:datePickerSourceSelectElementSales CONTENT=3
TAG POS=1 TYPE=A ATTR=ID:theForm:downloadLabel2
ONDOWNLOAD FOLDER=~/Downloads/iTCSales FILE=Daily-{{!NOW:yyyymmdd}}-3.txt.gz WAIT=YES
TAG POS=1 TYPE=DIV ATTR=TXT:Done
TAG POS=1 TYPE=DIV ATTR=TXT:Done
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:signOutForm ATTR=VALUE:Sign<SP>Out