A predator who groomed an under-age girl online has been jailed for 43 years after he tried to murder her in the street.