#!/usr/bin/perl use strict; use warnings; use utf8; use WWW::Mechanize; use Data::Dumper; use JSON; binmode STDOUT, ':encoding(UTF-8)'; binmode STDIN, ':encoding(UTF-8)'; my $url = 'https://www.autotrader.co.uk/'; my $mech = WWW::Mechanize -> new( autocheck => 1 ); $mech -> agent_alias( 'Linux Mozilla'); if ($mech -> status( $mech -> get($url)) == 200) { $mech -> form_name('searchVehicles'); my @inputs = $mech -> find_all_inputs( name_regex => qr/^(radius|make|model|price-to)$/, type => 'option',); print Dumper \@inputs; };