Mohammed Rafiq P Mohammed Rafiq P - 1 year ago 198
Ruby Question

Mechanize Ruby: Print Cookies

When I do agent.get(URL) I get blank results while when I access the URL directly I can see the results. Is it because some cookies are passed to the result page? Can you please help me to print cookies before agent.get(URL) so that I will know what is being passed?

Answer Source

I could solve this by adding the cookies before submitting the form.

agent =
cookie = '#{name}', value: '#{value}', domain: '#{domain}', path: '/')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download