java - Jsoup - How to choose an action of a form from several actions, then selecting an option -
i using jsoup develop application. code below not able specific action (that choose each time) , select option drop down menu. please me explain why not working.....or suggest me other way....
html code .. acct selected default. how select option?
<form name="prod_sel" action="course_open4.asp" method="post"> <p><select name="course" size="1"> <option value="acct" selected>acct</option> <option value="ae">ae</option> <option value="arc">arc</option> <option value="are">are</option> </select></p>
after selecting option, want submit form , go next page
<p align="center"><input type="submit" value="submit" name="b1"></p></form>
this second action , submission button
<form name="prod_sel" action="course_open3.asp" method="post"> <p><select name="course" size="1"> <option value="acct" selected>acct</option> <option value="ae">ae</option> <option value="arc">arc</option> <option value="are">are</option> </select> </p> <p align="center"><input type="submit" value="submit" name="b1"></p></form><div align="left">
this code
public class test6 { public static void main(string[] args) { try{ connection.response loginform = jsoup.connect("myurladdress") .method(connection.method.get) .execute(); document doc = jsoup.connect("myurladdress") .data("cookieexists", "false") .useragent("mozilla") .data("b1", "submit") .cookies(loginform.cookies()) .post(); system.out.println(doc); }catch(exception e){ e.printstacktrace(); } } }
i can't tell you're trying do, think case of wrong tool job. jsoup html parser, , doesn't run pages. you'll want use selenium if you're trying automate browsing website.
Comments
Post a Comment