used python and mechanize
python used instead of bash