Do not forget to look at BeautifulSoup, comes highly recommended.
See, for example, options-for-html-scraping.
If you need to select a programming language for this task, I'd say Python
.
A more direct solution to your question, see twill, a simple scripting language for Web browsing.