1HTTP::Recorder(3) User Contributed Perl Documentation HTTP::Recorder(3)
2
3
4
6 HTTP::Recorder - record interaction with websites
7
9 This module is deprecated
10 It works by tagging links in a page, and then when a link is clicked
11 looking on the submitted tag to see which link was clicked
12
13 It can not handle Javascript-created links or JS manipulation of the
14 page so it works only for fairly static websites
15
16 For better options check out Selenium
17
18 Patchs are welcome, and I'll fix bugs as much as I can, but please
19 don't expect me to implement new features
20
21 Using HTTP::Recorder as a Web Proxy
22 Set HTTP::Recorder as the user agent for a proxy, and it rewrites HTTP
23 responses so that additional requests can be recorded.
24
25 The Proxy Script
26
27 For quick start, run the httprecorder script
28
29 httprecorder
30
31 This will open a local proxy on port 8080, and will dump the recorded
32 traffic to a file named http_traffic in the current directory. use the
33 -help parameter for usage info
34
35 Start the proxy script, then change the settings in your web browser so
36 that it will use this proxy for web requests. For more information
37 about proxy settings and the default port, see HTTP::Proxy.
38
39 The script will be recorded in the specified file, and can be viewed
40 and modified via the control panel.
41
42 For better control, use this example:
43
44 #!/usr/bin/perl
45
46 use HTTP::Proxy;
47 use HTTP::Recorder;
48
49 my $proxy = HTTP::Proxy->new();
50
51 # create a new HTTP::Recorder object
52 my $agent = new HTTP::Recorder;
53
54 # set the log file (optional)
55 $agent->file("/tmp/myfile");
56
57 # set HTTP::Recorder as the agent for the proxy
58 $proxy->agent( $agent );
59
60 # start the proxy
61 $proxy->start();
62
63 Start Recording
64
65 Now you can use your browser as your normally would, and your actions
66 will be recorded in the file you specified. Alternatively, you can
67 start recording from the Control Panel.
68
69 Using the Control Panel
70
71 If you have Javascript enabled in your browser, go to the
72 HTTP::Recorder control URL (http://http-recorder by default),
73 optionally type a URL into the "Goto page" field, and click "Go".
74
75 In the new window, interact with web sites as you normally do,
76 including typing a new address into the address field. The Control
77 Panel will be updated after each recorded action.
78
79 The Control Panel allows you to modify, delete, or save your script.
80
81 SSL sessions
82 As of version 0.03, HTTP::Recorder can record SSL sessions.
83
84 To begin recording an SSL session, go to the control URL
85 (http://http-recorder/ by default), and enter the initial URL. Then,
86 interact with the web site as usual.
87
88 Script output
89 By default, HTTP::Recorder outputs WWW::Mechanize scripts.
90
91 However, you can override HTTP::Recorder::Logger to output other types
92 of scripts.
93
95 new
96 Creates and returns a new HTTP::Recorder object, referred to as the
97 'agent'.
98
99 $agent->prefix([$value])
100 Get or set the prefix string that HTTP::Recorder uses for rewriting
101 responses.
102
103 $agent->control([$value])
104 Get or set the URL of the control panel. By default, the control URL
105 is 'http-recorder'.
106
107 The control URL will display a control panel which will allow you to
108 view and edit the current script.
109
110 $agent->logger([$value])
111 Get or set the logger object. The default logger is a
112 HTTP::Recorder::Logger, which generates WWW::Mechanize scripts.
113
114 $agent->ignore_favicon([0|1])
115 Get or set ignore_favicon flag that causes HTTP::Recorder to skip
116 logging requests favicon.ico files. The value is 1 by default.
117
118 $agent->file([$value])
119 Get or set the filename for generated scripts. The default is
120 '/tmp/scriptfile'.
121
123 Javascript
124 WWW::Mechanize can't play back Javascript actions, and HTTP::Recorder
125 doesn't record them.
126
127 Why are my images corrupted?
128 HTTP::Recorder only tries to rewrite responses that are of type text/*,
129 which it determines by reading the Content-Type header of the
130 HTTP::Response object. However, if the received image gives the wrong
131 Content-Type header, it may be corrupted by the recorder. While this
132 may not be pleasant to look at, it shouldn't have an effect on your
133 recording session.
134
136 See also LWP::UserAgent, WWW::Mechanize, HTTP::Proxy.
137
139 Please submit any feature requests, suggestions, bugs, or patches at
140 http://rt.cpan.org/, or email to bug-HTTP-Recorder@rt.cpan.org.
141
142 If you're submitting a bug of the type "X doesn't record correctly," be
143 sure to include a (preferably short and simple) HTML page that
144 demonstrates the problem, and a clear explanation of a) what it does
145 that it shouldn't, and b) what it should do instead.
146
148 Copyright 2003-2005 by Linda Julien <leira@cpan.org>
149
150 Maintained by Shmuel Fomberg <semuelf@cpan.org>
151
152 Released under the GNU Public License.
153
154
155
156perl v5.30.0 2019-07-26 HTTP::Recorder(3)