On Aug 9, 9:30 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > Merdinus wrote: > > > Have seen this issue addressed on this board in the past, but can't > > figure out exactly what I need to do. > > > I'm using WWW::Mechanize and a webpage seems to be redirecting me but > > Mechanize doesn't seem to follow it. I've heard to "Add the header > > 'Accept: text/html'" but alas I don't know how to add the header, or > > what that means. > > > Any to save my sanity would all kinds of appreciated. > > If the redirect is being done with JavaScript then WWW::Mechanize will ignore > it, otherwise any GET, HEAD or POST request will be redirected as normal. > > Can you give us more information on which URL it is that is being redirected? > What status code are you getting from the initial GET? > > Rob
Thanks for the replies. The redirect is happening after a $mech- >submit_form(...) The webpage is at: http://patft.uspto.gov/netahtml/PTO/srchnum.htm The submit form is submitting all the hidden variables in the webpage as well as a 7 digit number for a patent (ex. 7123456). To gather info, after the call to "submit_form" I've edited the code to I've printed $mech->uri() to a file. I then copied and pasted that string into a browser and the browser (IE7) happily gets redirected on, so it seems that submit_form is bringing me from the "start" webpage to the "middle" webpage, but then it's not carrying me on to the final webpage. I could have sworn I've tried the $mech->redirect_ok() and got an error - some error deep in the code (i.e. below my code and in the perl code underneath). But maybe I did it wrong, who knows. Sorry I can't be more specific about this attempt, the code I put together is at work and I can't access it. Tomorrow (Sunday the 10th) I'll try to rewrite all the code on this computer for debugging - shouldn't be too hard, there wasn't much. Final piece of info: I downloaded my perl executable from ActiveState (sometime last week, and I downloaded the most recent version available) - if that info means anything of importance. Thanks again for the replies and any help is much appreciated. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/