On Wednesday, June 10, 2015 at 10:08:48 AM UTC-7, kristofBLR wrote: > > Hello. I am trying to create a parser, that will scrape info about iphone > warranty status. I have an URL - > https://selfsolve.apple.com/agreementWarrantyDynamic.do > <https://www.google.com/url?q=https%3A%2F%2Fselfsolve.apple.com%2FagreementWarrantyDynamic.do&sa=D&sntz=1&usg=AFQjCNG7DaWGFtxXJBOqYDIg0sN6eL2ing> > > and i need to fill the form with an IMEI and press Continue to get info > about the phone. I am using mechanize for this. The problem is - there is a > hidden field in this form - http://goo.gl/AMlNfC And this field is filled > automatically with a random number when i interact with page via browser. > So if i open this page with mechanize, i should fill this field manually > with that random generated number. I've figured out in which part of code > this number generated - http://goo.gl/P8nvpx The problem is - it's inside > JavaScript function. I am not very strong at JS and i have no idea how to > fetch this number using mechanize. Maybe Watir can help me do this? The > problem is, i don't understand how Watir interact with JavaScript on the > page. I know how to fetch data from HTML with Xpath, or with CSS selectors, > but i have no idea how can i get that number from JS function. Any help > will be appreciated. >
Word of caution, check the terms of service on that site, they pretty specifically disallow what you are talking about doing You may not use any “deep-link”, “page-scrape”, “robot”, “spider” or other > automatic device, program, algorithm or methodology, or any similar or > equivalent manual process, to access, acquire, copy or monitor any portion > of the Site or any Content, or in any way reproduce or circumvent the > navigational structure or presentation of the Site or any Content, to > obtain or attempt to obtain any materials, documents or information through > any means not purposely made available through the Site. Apple reserves the > right to bar any such activity. So it would be best to contact apple for permission, or find out if there is an API you could access to do what you want (which is superior to trying to do site scraping) Be warned that many community members will not respond to requests for help automating against a site where their terms of use prohibits such things. (which might explain the long duration this question went without response -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
