sending a form with mechanzie(Ruby) returns and empty page? -


i want scrape list of offers of given product amazon.com quantity in stoke each offer. find last information (quantity) need add offer cart, edit cart quantity 999. , quantity next page.

take example product (http://www.amazon.com/gp/offer-listing/b00dw58enu/ref=olp_tab_all&startindex=1) button add cart form single submit. can find form code

offer_form = agent.page.forms_with(action: /item-dispatch/)[0] ##<mechanize::form # {name nil} # {method "post"} #{action "/gp/item-dispatch/ref=olp_atc_new_1/181-7026511-7466349"} # {fields #  [hidden:0x1717018 type: hidden name: session-id value: 181-7026511-7466349] #  [hidden:0x1716a8c type: hidden name: qid value: ] #  [hidden:0x1716514 type: hidden name: sr value: ] #  [hidden:0x1715eac type: hidden name: signintohuc value: 0] #  [hidden:0x17155d8 type: hidden name: metric-asin.b00nhqfa1i value: 1] #  [hidden:0x1714e80 type: hidden name: registryitemid.1 value: ] #  [hidden:0x1714a0c type: hidden name: registryid.1 value: ] #  [hidden:0x1714598 type: hidden name: quantity.1 value: 1] #  [hidden:0x1714138 type: hidden name: offeringid.1 value: rvm%2fgzxznrortyxf%2f8figjvfjfscvgo1jjbeluslb7hlttelacwmvhke7nsgke1lbmgmkm3oodmhttbnkt%2fcp%2fnfet7sbolzdnrfmvwrfa0n7ahrtvnphw%3d%3d] #  [hidden:0x1707938 type: hidden name: isaddon value: 0]} # {radiobuttons} # {checkboxes} # {file_uploads} # {buttons #  [submit:0x17072e4 type: submit name: submit.addtocart value: add #cart]}>  page = offer_form.submit ##<mechanize::page # {url #<uri::http http://www.amazon.com/gp/item-dispatch/ref=olp_atc_new_1>} # {meta_refresh} # {title nil} # {iframes} # {frames} # {links} # {forms}> 

i wondering why got empty page result.

i though maybe because action different real 1 found when open page using browser (chrome of firefox). if change offer_form.action found on browser. not change result, , still empty page.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -