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 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. >
Since watir-webdriver interacts with the browser in much the same way a real user would (it actually drives the browser) it does not need to try to parse or execute JS code, since the browser does that. So watir is likely going to be able to do what you need. Since you are starting from zero, I might recommend looking at some of the basics at watir-webdriver.com, or for a more in depth tutorial consider https://leanpub.com/watirbook -- -- 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.
