Closed cmessinger closed 9 years ago
Hello Craig,
The page.form(String) method uses several mechanisms to lookup a form, but not the full URI.
The best option is to use the id or unique class attributes on the form, but that might not be stable for pages from google.
Also, the getUri() method is actually resolving between absolute and relative uri references with the base uri of the page.
If that URI value is the only stable thing you can use to find the form in question, then I think looping over the forms and looking for a matching value is your best option.
-John
When creating a simple login script for a site such as google, when getting the form to set the values for the login credentials the form is null.
How is the look up done to get a form? I have tried the value of the id and action for the form both return null.
-form is null
The page has the form that I need as can been seen using the code
for (Form temp : resultPage.forms()) System.out.println(temp.getUri());
outputs: https://accounts.google.com/ServiceLoginAuth which is where it will post to.