I am trying to write cgi scripts that extracts parts of certain web page with regex, and display that on the browser.
Here is the script I wrote
#!/usr/bin/perl use LWP::UserAgent; print "Content-type: text/html\n\n"; $user_agent = new LWP::UserAgent; $user_agent->timeout(10); $request = new HTTP::Request('GET' , 'http://www.ypbooks.co.kr/ypbooks +/WebHome/dqsearch/isbn.jsp?isbn=8957590528'); $response = $user_agent->request($request); print $response->content; # end of script
here I want to get web page "http://www.ypbooks.co.kr/ypbooks/WebHome/dqsearch/isbn.jsp?isbn=8957590528"
but this address is immediately redirected to different address "http://www.ypbooks.co.kr/ypbooks/WebHome/specdm/specdm.jsp?p_isbn=2210100105"
but I can not extract the part of the first address page with Regular Expression This redirection is not under control of my cgi script. If this redirection is controlled by my scripts, I could extract part of the redirected web page, but I can't and the second, redirected address page is displayed having its own address on the browser. How can I extract the part of redirected web page only knowing the first address and not knowing the second, redirected address?
Edit: g0n - added formatting
In reply to redirection problem by ygcho_jason
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |