in reply to Screen scraping

See for example Mojo::DOM or a combination of HTML::TreeBuilder and HTML::Selector::XPath. I've combined the two into App::scrape, but you may want to look at the actual code of App::scrape and write your own version.