Thread: Re: [Htmlparser-user] Button Links
Brought to you by:
derrickoswald
From: Derrick O. <der...@ro...> - 2007-04-01 03:15:50
|
The button is probably in a form with a POST type submission method required. You can see how to handle POST for a form in the FAQ under How can I use POST to fetch a page? ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htm...@li... Sent: Saturday, March 31, 2007 11:06:15 PM Subject: [Htmlparser-user] Button Links I am trying to create a java program that will follow a series of links. However, the first link is not a link per se, but a button, and the link parser doesn't recognize it as a link. The source of the button is <input type="submit" value= "Sign in" /> I am fairly new at using this, so I would appreciate some pointers on where to look to find out how to accomplish this. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Derrick O. <der...@ro...> - 2007-04-01 15:56:20
|
I'm not sure what your question is. As it says in the FAQ example a StringBean is used: bean = new StringBean (); bean.setConnection (connection); mText = bean.getStrings (); But a parser could be used by just replacing the last three lines in the try block with: parser = new Parser (); parser.setConnection (connection); // ... do parser operation So, you are actually passing the fully functional URL connection object to the Parser instead of making it do a GET behind the scenes on a (string) URL. If what you are asking is how to use the parser, check out the Parser javadoc, basically get a list of nodes and do something with it: NodeList list = parser.parse (null); // do something with your list of nodes. ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htmlparser user list <htm...@li...> Sent: Sunday, April 1, 2007 1:21:27 AM Subject: Re: [Htmlparser-user] Button Links So after the POST has been completed sucessfully, how does one than perform parsing operations on what has occurred? In other words, how would the URL of the site the program gets routed to be found? On 3/31/07, Derrick Oswald <der...@ro...> wrote: The button is probably in a form with a POST type submission method required. You can see how to handle POST for a form in the FAQ under How can I use POST to fetch a page? ----- Original Message ---- From: Cliff Holbrook < cli...@gm...> To: htm...@li... Sent: Saturday, March 31, 2007 11:06:15 PM Subject: [Htmlparser-user] Button Links I am trying to create a java program that will follow a series of links. However, the first link is not a link per se, but a button, and the link parser doesn't recognize it as a link. The source of the button is <input type="submit" value= "Sign in" /> I am fairly new at using this, so I would appreciate some pointers on where to look to find out how to accomplish this. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Cliff H. <cli...@gm...> - 2007-04-01 16:42:09
|
After looking closer at the the code, it seems as though there is a "select" menu in the POST that I cannot figure out how to set. The HTML for it is <select name="world"> <option></option> <option value="1" selected="selected">World 1</option></select> I can't find any info in the how to use POST on how to submit the information. It also seems to me as though the default is to have "World 1" selected, and so I don't understand why it has to have it sent in again. Thank you for your help On 4/1/07, Derrick Oswald <der...@ro...> wrote: > > I'm not sure what your question is. > As it says in the FAQ example a StringBean is used: > > bean = new StringBean (); > bean.setConnection (connection); > mText = bean.getStrings (); > > > But a parser could be used by just replacing the last three lines in the > try block with: > > parser = new Parser (); > parser.setConnection (connection); > // ... do parser operation > > So, you are actually passing the fully functional URL connection object to > the Parser instead of making it do a GET behind the scenes on a (string) > URL. > If what you are asking is how to use the parser, check out the Parser > javadoc<http://htmlparser.sourceforge.net/javadoc/org/htmlparser/Parser.html>, > basically get a list of nodes and do something with it: > > NodeList list = parser.parse (null); > // do something with your list of nodes. > > > ----- Original Message ---- > From: Cliff Holbrook <cli...@gm...> > To: htmlparser user list <htm...@li...> > Sent: Sunday, April 1, 2007 1:21:27 AM > Subject: Re: [Htmlparser-user] Button Links > > So after the POST has been completed sucessfully, how does one than > perform parsing operations on what has occurred? In other words, how would > the URL of the site the program gets routed to be found? > > On 3/31/07, Derrick Oswald <der...@ro...> wrote: > > > > The button is probably in a form with a POST type submission method > > required. > > You can see how to handle POST for a form in the FAQ<http://htmlparser.sourceforge.net/faq.html>under How > > can I use POST to fetch a page?<http://htmlparser.sourceforge.net/faq.html#post> > > > > ----- Original Message ---- > > From: Cliff Holbrook < cli...@gm...> > > To: htm...@li... > > Sent: Saturday, March 31, 2007 11:06:15 PM > > Subject: [Htmlparser-user] Button Links > > > > I am trying to create a java program that will follow a series of > > links. However, the first link is not a link per se, but a button, and the > > link parser doesn't recognize it as a link. The source of the button is > > > > <input type="submit" value= > > "Sign in" /> > > > > > > I am fairly new at using this, so I would appreciate some pointers on > > where to look to find out how to accomplish this. > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > > your > > opinions on IT & business topics through brief surveys-and earn cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Htmlparser-user mailing list > > Htm...@li... > > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > > your > > opinions on IT & business topics through brief surveys-and earn cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Htmlparser-user mailing list > > Htm...@li... > > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > > > > -- > "Programming today is a race between software engineers striving to build > bigger and better idiot-proof programs, and the Universe trying to produce > bigger and better idiots. So far, the Universe is winning." > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." |
From: Derrick O. <der...@ro...> - 2007-04-01 17:00:16
|
I believe you would just add it as a parameter. Using the FAQ example it would be done like so: buffer = new StringBuffer (1024); // 'input' fields separated by ampersands (&) buffer.append ("world=1"); // name=value or buffer.append ("world="); // if the nothing option is selected // etc. ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htmlparser user list <htm...@li...> Sent: Sunday, April 1, 2007 12:42:06 PM Subject: Re: [Htmlparser-user] Button Links After looking closer at the the code, it seems as though there is a "select" menu in the POST that I cannot figure out how to set. The HTML for it is <select name="world"> <option></option> < option value="1" selected="selected">World 1</ option></select> I can't find any info in the how to use POST on how to submit the information. It also seems to me as though the default is to have "World 1" selected, and so I don't understand why it has to have it sent in again. Thank you for your help On 4/1/07, Derrick Oswald <der...@ro...> wrote: I'm not sure what your question is. As it says in the FAQ example a StringBean is used: bean = new StringBean (); bean.setConnection (connection); mText = bean.getStrings (); But a parser could be used by just replacing the last three lines in the try block with: parser = new Parser (); parser.setConnection (connection); // ... do parser operation So, you are actually passing the fully functional URL connection object to the Parser instead of making it do a GET behind the scenes on a (string) URL. If what you are asking is how to use the parser, check out the Parser javadoc , basically get a list of nodes and do something with it: NodeList list = parser.parse (null); // do something with your list of nodes. ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htmlparser user list <htm...@li... > Sent: Sunday, April 1, 2007 1:21:27 AM Subject: Re: [Htmlparser-user] Button Links So after the POST has been completed sucessfully, how does one than perform parsing operations on what has occurred? In other words, how would the URL of the site the program gets routed to be found? |
From: Cliff H. <cli...@gm...> - 2007-04-01 17:21:38
|
using "world=1" "world=" by itself, "world=" with "1" and "selected", and trying to set value = 1 and selected = to "selected" doesn't work. I can't think of any other combination to use. On 4/1/07, Derrick Oswald <der...@ro...> wrote: > > I believe you would just add it as a parameter. Using the FAQ example it > would be done like so: > > buffer = new StringBuffer (1024); > // 'input' fields separated by ampersands (&) > buffer.append ("world=1"); // name=value > or > buffer.append ("world="); // if the nothing option is selected > // etc. > > > > ----- Original Message ---- > From: Cliff Holbrook <cli...@gm...> > To: htmlparser user list <htm...@li...> > Sent: Sunday, April 1, 2007 12:42:06 PM > Subject: Re: [Htmlparser-user] Button Links > > After looking closer at the the code, it seems as though there is a > "select" menu in the POST that I cannot figure out how to set. The HTML for > it is > > <select > name="world"> > <option></option> > < > option value="1" selected="selected">World 1</ > option></select> > > > > I can't find any info in the how to use POST on how to submit the > information. It also seems to me as though the default is to have "World 1" > selected, and so I don't understand why it has to have it sent in again. > > Thank you for your help > > On 4/1/07, Derrick Oswald <der...@ro...> wrote: > > > > I'm not sure what your question is. > > As it says in the FAQ example a StringBean is used: > > > > bean = new StringBean (); > > bean.setConnection (connection); > > mText = bean.getStrings (); > > > > > > But a parser could be used by just replacing the last three lines in the > > try block with: > > > > parser = new Parser (); > > parser.setConnection (connection); > > // ... do parser operation > > > > So, you are actually passing the fully functional URL connection object > > to the Parser instead of making it do a GET behind the scenes on a (string) > > URL. > > If what you are asking is how to use the parser, check out the Parser > > javadoc > > <http://htmlparser.sourceforge.net/javadoc/org/htmlparser/Parser.html>, > > basically get a list of nodes and do something with it: > > > > NodeList list = parser.parse (null); > > // do something with your list of nodes. > > > > > > ----- Original Message ---- > > From: Cliff Holbrook <cli...@gm...> > > To: htmlparser user list <htm...@li... > > > Sent: Sunday, April 1, 2007 1:21:27 AM > > Subject: Re: [Htmlparser-user] Button Links > > > > So after the POST has been completed sucessfully, how does one than > > perform parsing operations on what has occurred? In other words, how would > > the URL of the site the program gets routed to be found? > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." |
From: Derrick O. <der...@ro...> - 2007-04-01 20:13:29
|
By 'doesn't work' you mean you aren't getting the page you expect? There may be any number of reasons for that. There may be other inputs from the form you need to supply. Also too, there may be cookies on redirections that may need to be supplied. Try using: org.htmlparser.http.ConnectionManager.setRedirectionProcessingEnabled (true); org.htmlparser.http.ConnectionManager.setCookieProcessingEnabled (true); Also some sites require a specific agent. See the documentation on org.htmlparser.http.ConnectionManager.setDefaultRequestProperties() If all else fails, try a simple case - on another server say - to get the hang of the POST before tackling the page you desire. ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htmlparser user list <htm...@li...> Sent: Sunday, April 1, 2007 1:21:35 PM Subject: Re: [Htmlparser-user] Button Links using "world=1" "world=" by itself, "world=" with "1" and "selected", and trying to set value = 1 and selected = to "selected" doesn't work. I can't think of any other combination to use. On 4/1/07, Derrick Oswald <der...@ro...> wrote: I believe you would just add it as a parameter. Using the FAQ example it would be done like so: buffer = new StringBuffer (1024); // 'input' fields separated by ampersands (&) buffer.append ("world=1"); // name=value or buffer.append ("world="); // if the nothing option is selected // etc. ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htmlparser user list < htm...@li...> Sent: Sunday, April 1, 2007 12:42:06 PM Subject: Re: [Htmlparser-user] Button Links After looking closer at the the code, it seems as though there is a "select" menu in the POST that I cannot figure out how to set. The HTML for it is <select name= "world"> <option></option> < option value="1" selected="selected">World 1</ option></select> I can't find any info in the how to use POST on how to submit the information. It also seems to me as though the default is to have "World 1" selected, and so I don't understand why it has to have it sent in again. Thank you for your help On 4/1/07, Derrick Oswald < der...@ro...> wrote: I'm not sure what your question is. As it says in the FAQ example a StringBean is used: bean = new StringBean (); bean.setConnection (connection); mText = bean.getStrings (); But a parser could be used by just replacing the last three lines in the try block with: parser = new Parser (); parser.setConnection (connection); // ... do parser operation So, you are actually passing the fully functional URL connection object to the Parser instead of making it do a GET behind the scenes on a (string) URL. If what you are asking is how to use the parser, check out the Parser javadoc , basically get a list of nodes and do something with it: NodeList list = parser.parse (null); // do something with your list of nodes. ----- Original Message ---- From: Cliff Holbrook <cli...@gm... > To: htmlparser user list <htm...@li... > Sent: Sunday, April 1, 2007 1:21:27 AM Subject: Re: [Htmlparser-user] Button Links So after the POST has been completed sucessfully, how does one than perform parsing operations on what has occurred? In other words, how would the URL of the site the program gets routed to be found? ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: Cliff H. <cli...@gm...> - 2007-04-01 21:06:08
|
It is going to the page where it says that the select input was unsupplied. As in. the text on the page says "No World Selected". I believe that everything else is working fine, it is just that one part. On 4/1/07, Derrick Oswald <der...@ro...> wrote: > > By 'doesn't work' you mean you aren't getting the page you expect? > There may be any number of reasons for that. > There may be other inputs from the form you need to supply. > Also too, there may be cookies on redirections that may need to be > supplied. > Try using: > org.htmlparser.http.ConnectionManager.setRedirectionProcessingEnabled(true); > org.htmlparser.http.ConnectionManager.setCookieProcessingEnabled (true); > Also some sites require a specific agent. See the documentation on > org.htmlparser.http.ConnectionManager.setDefaultRequestProperties() > If all else fails, try a simple case - on another server say - to get the > hang of the POST before tackling the page you desire. > > ----- Original Message ---- > From: Cliff Holbrook <cli...@gm...> > To: htmlparser user list <htm...@li...> > Sent: Sunday, April 1, 2007 1:21:35 PM > Subject: Re: [Htmlparser-user] Button Links > > using "world=1" "world=" by itself, "world=" with "1" and "selected", and > trying to set value = 1 and selected = to "selected" doesn't work. I can't > think of any other combination to use. > > On 4/1/07, Derrick Oswald <der...@ro...> wrote: > > > > I believe you would just add it as a parameter. Using the FAQ example it > > would be done like so: > > > > buffer = new StringBuffer (1024); > > // 'input' fields separated by ampersands (&) > > buffer.append ("world=1"); // name=value > > or > > buffer.append > > ("world="); // if the nothing option is selected > > // etc. > > > > > > > > ----- Original Message ---- > > From: Cliff Holbrook <cli...@gm...> > > To: htmlparser user list < htm...@li...> > > Sent: Sunday, April 1, 2007 12:42:06 PM > > Subject: Re: [Htmlparser-user] Button Links > > > > After looking closer at the the code, it seems as though there is a > > "select" menu in the POST that I cannot figure out how to set. The HTML for > > it is > > > > <select > > name= > > "world"> > > <option></option> > > < > > option value="1" selected="selected">World 1</ > > > > option></select> > > > > > > > > I can't find any info in the how to use POST on how to submit the > > information. It also seems to me as though the default is to have "World 1" > > selected, and so I don't understand why it has to have it sent in again. > > > > Thank you for your help > > > > On 4/1/07, Derrick Oswald < der...@ro...> wrote: > > > > > > I'm not sure what your question is. > > > As it says in the FAQ example a StringBean is used: > > > > > > bean = new StringBean (); > > > bean.setConnection (connection); > > > mText = bean.getStrings (); > > > > > > > > > But a parser could be used by just replacing the last three lines in > > > the try block with: > > > > > > parser = new Parser (); > > > parser.setConnection (connection); > > > // ... do parser operation > > > > > > So, you are actually passing the fully functional URL connection > > > object to the Parser instead of making it do a GET behind the scenes on a > > > (string) URL. > > > If what you are asking is how to use the parser, check out the Parser > > > javadoc > > > <http://htmlparser.sourceforge.net/javadoc/org/htmlparser/Parser.html>, > > > basically get a list of nodes and do something with it: > > > > > > NodeList list = parser.parse (null); > > > // do something with your list of nodes. > > > > > > > > > ----- Original Message ---- > > > From: Cliff Holbrook <cli...@gm... > > > > To: htmlparser user list <htm...@li... > > > > Sent: Sunday, April 1, 2007 1:21:27 AM > > > Subject: Re: [Htmlparser-user] Button Links > > > > > > So after the POST has been completed sucessfully, how does one than > > > perform parsing operations on what has occurred? In other words, how would > > > the URL of the site the program gets routed to be found? > > > > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > > your > > opinions on IT & business topics through brief surveys-and earn cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Htmlparser-user mailing list > > Htm...@li... > > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > > > > > -- > "Programming today is a race between software engineers striving to build > bigger and better idiot-proof programs, and the Universe trying to produce > bigger and better idiots. So far, the Universe is winning." > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." |
From: Derrick O. <der...@ro...> - 2007-04-01 21:34:25
|
>From the HTML specification: For menus, the control name is provided by a SELECT element and values are provided by OPTION elements. Only selected options may be successful. When no options are selected, the control is not successful and neither the name nor any values are submitted to the server when the form is submitted A control's "control name" is given by its name attribute. The scope of the name attribute for a control within a FORM element is the FORM element. Each control has both an initial value and a current value, both of which are character strings. Please consult the definition of each control for information about initial values and possible constraints on values imposed by the control. In general, a control's "initial value" may be specified with the control element's value attribute. However, the initial value of a TEXTAREA element is given by its contents, and the initial value of an OBJECT element in a form is determined by the object implementation (i.e., it lies outside the scope of this specification). The control's "current value" is first set to the initial value. Thereafter, the control's current value may be modified through user interaction and scripts. A control's initial value does not change. Thus, when a form is reset, each control's current value is reset to its initial value. If a control does not have an initial value, the effect of a form reset on that control is undefined. When a form is submitted for processing, some controls have their name paired with their current value and these pairs are submitted with the form. Those controls for which name/value pairs are submitted are called successful controls. For you, this should be "world=1", a pairing of the name attribute of the SELECT tag with the value attribute of the selected OPTION. Note that if there are many inputs the name/value pairs need to be separated by semicolons: buffer.append ("queryinput=yadda"); buffer.append ("&"); buffer.append ("world=1"); // etc. ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htmlparser user list <htm...@li...> Sent: Sunday, April 1, 2007 5:06:02 PM Subject: Re: [Htmlparser-user] Button Links It is going to the page where it says that the select input was unsupplied. As in. the text on the page says "No World Selected". I believe that everything else is working fine, it is just that one part. On 4/1/07, Derrick Oswald <der...@ro...> wrote: By 'doesn't work' you mean you aren't getting the page you expect? There may be any number of reasons for that. There may be other inputs from the form you need to supply. Also too, there may be cookies on redirections that may need to be supplied. Try using: org.htmlparser.http.ConnectionManager.setRedirectionProcessingEnabled (true); org.htmlparser.http.ConnectionManager.setCookieProcessingEnabled (true); Also some sites require a specific agent. See the documentation on org.htmlparser.http.ConnectionManager.setDefaultRequestProperties () If all else fails, try a simple case - on another server say - to get the hang of the POST before tackling the page you desire. ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htmlparser user list <htm...@li...> Sent: Sunday, April 1, 2007 1:21:35 PM Subject: Re: [Htmlparser-user] Button Links using "world=1" "world=" by itself, "world=" with "1" and "selected", and trying to set value = 1 and selected = to "selected" doesn't work. I can't think of any other combination to use. On 4/1/07, Derrick Oswald < der...@ro...> wrote: I believe you would just add it as a parameter. Using the FAQ example it would be done like so: buffer = new StringBuffer (1024); // 'input' fields separated by ampersands (&) buffer.append ("world=1"); // name=value or buffer.append ("world="); // if the nothing option is selected // etc. ----- Original Message ---- From: Cliff Holbrook <cli...@gm...> To: htmlparser user list < htm...@li...> Sent: Sunday, April 1, 2007 12:42:06 PM Subject: Re: [Htmlparser-user] Button Links After looking closer at the the code, it seems as though there is a "select" menu in the POST that I cannot figure out how to set. The HTML for it is <select name= "world"> <option></option> < option value="1" selected="selected" >World 1</ option></select> I can't find any info in the how to use POST on how to submit the information. It also seems to me as though the default is to have "World 1" selected, and so I don't understand why it has to have it sent in again. Thank you for your help |
From: Cliff H. <cli...@gm...> - 2007-04-01 05:21:30
|
So after the POST has been completed sucessfully, how does one than perform parsing operations on what has occurred? In other words, how would the URL of the site the program gets routed to be found? On 3/31/07, Derrick Oswald <der...@ro...> wrote: > > The button is probably in a form with a POST type submission method > required. > You can see how to handle POST for a form in the FAQ<http://htmlparser.sourceforge.net/faq.html>under How > can I use POST to fetch a page?<http://htmlparser.sourceforge.net/faq.html#post> > > ----- Original Message ---- > From: Cliff Holbrook <cli...@gm...> > To: htm...@li... > Sent: Saturday, March 31, 2007 11:06:15 PM > Subject: [Htmlparser-user] Button Links > > I am trying to create a java program that will follow a series of links. > However, the first link is not a link per se, but a button, and the link > parser doesn't recognize it as a link. The source of the button is > > <input type="submit" value= > "Sign in" /> > > > I am fairly new at using this, so I would appreciate some pointers on > where to look to find out how to accomplish this. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." |