ruby on rails - dealing with phpsessid using mechanize -
am trying crawl website everytime need phpsessid request_headers cookie firebug or return 500 , tried generate phpsessid using securerandom.hex(13) won't works , solution fix ?
= mechanize.new a.request_headers = { "accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "content-type" => "application/x-www-form-urlencoded; charset=utf-8", "host" => "www.website.com", "referer" => "http://www.website.com/equipment", "accept-encoding" => "gzip, deflate", "x-requested-with" => "xmlhttprequest", "pragma" => "no-cache", "cookie" => "__alti_visits=1; __papvisitorid=#{securerandom.hex(16)}; __alti_visits=2; phpsessid=#{securerandom.hex(13)}; skimiuml=2; __altima_newvisit_detect=1;" } a.post("http://www.website.com/action", { "display" => "desktop", "category" => "#{product_type_id[c]}", "target" => "#{product_genre_id[a1]}" })
a similar question maintaining cookies between mechanize requests. did try that?
Comments
Post a Comment