<?xml version="1.0" encoding="windows-1252"?>
<node id="1003678" title="Using LWP::Simple to read a redirected page" created="2012-11-13 12:43:29" updated="2012-11-13 12:43:29">
<type id="115">
perlquestion</type>
<author id="966135">
MorayJ</author>
<data>
<field name="doctext">
&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The UK government has changed its website and I'm trying to check up on links that I have to see if they still work on the new structure&lt;/p&gt;
&lt;p&gt;I'm using LWP::Simple for this&lt;/p&gt;
&lt;p&gt;If I put in the web address &lt;code&gt;https://www.insolvencydirect.gov.uk/isolv&lt;/code&gt;, it very kindly returns &lt;code&gt;http://www.bis.gov.uk/insolvency&lt;/code&gt; when I use &lt;code&gt;$request-&gt;uri&lt;/code&gt; ($request being found with: 
&lt;code&gt;
my $browser = LWP::UserAgent-&gt;new;
my $response = $browser-&gt;get( $url );
my $request = $response-&gt;request();&lt;/code&gt;) 
&lt;/p&gt;
&lt;p&gt;This is where the site now sends you if you go to that url&lt;/p&gt;
&lt;p&gt;Difficulty is encountered with other links, like &lt;code&gt;www.direct.gov.uk/en/Motoring/OwningAVehicle/TaxationClasses/DG_4022042&lt;/code&gt; which takes you to &lt;code&gt;https://www.gov.uk/vehicle-exempt-from-car-tax&lt;/code&gt; if you use a browser, but which &lt;code&gt;$request-&gt;uri&lt;/code&gt; returns the original url I put in.&lt;/p&gt;
&lt;p&gt;What are they doing differently? What do I need to do differently? I guess it's probably more of a web question that just about perl.&lt;/p&gt;
&lt;p&gt;Thanks for any advice&lt;/p&gt;
&lt;p&gt;MorayJ&lt;/p&gt;</field>
</data>
</node>
