| View previous topic :: View next topic |
| Author |
Message |
Luke NeoBooker
Joined: 17 Nov 2005 Posts: 35
|
Posted: Wed Oct 04, 2006 7:32 am Post subject: Browser setElement |
|
|
BrowserSetElement "WebBrowser1" "youremail" "luke@yahoo.com"
BrowserSetElement "WebBrowser1" "yourpassword" "lukespass"
Next I want to simulate pressing The " login" button on the webbrowser ...
How can i do it ? |
|
| Back to top |
|
 |
Neosoft Support NeoSoft Team
Joined: 31 Mar 2005 Posts: 4048 Location: Oregon, USA
|
Posted: Wed Oct 04, 2006 10:42 am Post subject: |
|
|
Try this:
| Code: | | BrowserExecScript "WebBrowser1" "document.getElementById([#34]ButtonName[#34]).click()" "JavaScript" |
Replace "ButtonName" with the name of the button you want to click. _________________ NeoSoft Support |
|
| Back to top |
|
 |
Gaev NeoBooker

Joined: 01 Apr 2005 Posts: 4321 Location: Toronto, Canada
|
|
| Back to top |
|
 |
Abdullah NeoBooker

Joined: 10 Mar 2009 Posts: 60 Location: Palestine
|
Posted: Tue Jan 26, 2010 1:04 pm Post subject: |
|
|
mmm , very interesting post
understand the logic but dont know how to link all these things
my require is how to simulate post method for example enter user name and password and access to website
i know how to do when the website use get method , but with post dont know
i am playing now how to do that , mm if anybody can give me an example for this , will be welcomed
thanks _________________ Abdullah |
|
| Back to top |
|
 |
Abdullah NeoBooker

Joined: 10 Mar 2009 Posts: 60 Location: Palestine
|
Posted: Tue Jan 26, 2010 1:23 pm Post subject: |
|
|
my code is
| Code: | SetVar "[WebBrowser2Addr]" "..."
BrowserSetElement "WebBrowser2" "Name" "...."
BrowserSetElement "WebBrowser2" "Password" "...."
BrowserExecScript "WebBrowser2" "document.getElementById([#34]Enter[#34]).click()" "JScript" |
with no success  _________________ Abdullah |
|
| Back to top |
|
 |
Neosoft Support NeoSoft Team
Joined: 31 Mar 2005 Posts: 4048 Location: Oregon, USA
|
Posted: Tue Jan 26, 2010 2:46 pm Post subject: |
|
|
In order for BrowserSetElement to work, you need to know something about how the HTML page was constructed. They are all different. For example, given the following HTML content:
| Code: | <form name="mainform">
<p><font face="Arial">First Name: <input NAME="FirstName" value="" size="20"></font></p>
<p><font face="Arial">Last Name: <input NAME="LastName" value="" size="20"></font></p>
<p><font face="Arial"><BUTTON NAME="B1" onclick="SetVars()">Send Data to NeoBook</button><br>
<small>Click this button to send information to NeoBook.</small></font></p>
<p><font face="Arial"><BUTTON NAME="B2" onclick="GetVars()">Get Data from NeoBook</button><br>
<small>Click this button to retrieve information from NeoBook.</small></font></p>
</form> |
...the following NeoBook script will set the values of the FirstName and LastName text fields:
| Code: | BrowserSetElement "WebBrowser1" "FirstName" "Joe"
BrowserSetElement "WebBrowser1" "LastName" "Smith" |
If the names assigned to the text fields are different, then the NeoBook script would need to be changed to reflect that or it won't work. _________________ NeoSoft Support |
|
| Back to top |
|
 |
Abdullah NeoBooker

Joined: 10 Mar 2009 Posts: 60 Location: Palestine
|
Posted: Thu Jan 28, 2010 3:52 pm Post subject: |
|
|
Hello Neosoft,
thanks for your reply , but i tried that before i post my first reply here with no luck
as i understood this way to access websites that work in post method not get method ,, is that right?
good luck _________________ Abdullah |
|
| Back to top |
|
 |
Neosoft Support NeoSoft Team
Joined: 31 Mar 2005 Posts: 4048 Location: Oregon, USA
|
Posted: Fri Jan 29, 2010 11:53 am Post subject: |
|
|
What website are you trying to access - your own or someone else's?
| Quote: | | as i understood this way to access websites that work in post method not get method ,, is that right? |
NeoBook includes InternetGet and InternetPost actions, but these are entirely different from the BrowserSetElement action being discussed here. _________________ NeoSoft Support |
|
| Back to top |
|
 |
Abdullah NeoBooker

Joined: 10 Mar 2009 Posts: 60 Location: Palestine
|
Posted: Sat Jan 30, 2010 1:08 am Post subject: |
|
|
Hi Neosoft
i have a website that i have an account on it
i want to send my username and password to it and show my account homepage using neobook
tried internetpost/get action in the past with no luck , the website uses post method ..
good luck _________________ Abdullah |
|
| Back to top |
|
 |
Gaev NeoBooker

Joined: 01 Apr 2005 Posts: 4321 Location: Toronto, Canada
|
Posted: Sat Jan 30, 2010 9:05 am Post subject: |
|
|
Abdullah:
What is the URL of the webpage that (normally) presents a Login facility to you when you use a Browser (like Internet Explorer) ?
InternetGet and InternetPost are not the way to go for what you have described above as your requirement.
Instead, you will need to have a WebBrowser object ... and pass it the URL ... and then populate the User/Password Boxes from NeoBook ... this step is unique to each situation as there are many ways to code the html/javascript for this ... and a lot of web sites go to great lengths to thwart such automatic logins (from hackers, spammers etc.) ... including the use of the CAPTCHA image (where humans can decipher wobbly text in an image but computers can't) ... finally, you have to simulate the submit button of the login facility. _________________ Gaev
http://www.scriptedlogic.com/ |
|
| Back to top |
|
 |
dpayer NeoBooker

Joined: 11 Apr 2005 Posts: 890
|
Posted: Sun Jan 31, 2010 12:05 pm Post subject: |
|
|
| Abdullah wrote: | Hi Neosoft
i have a website that i have an account on it
i want to send my username and password to it and show my account homepage using neobook
tried internetpost/get action in the past with no luck , the website uses post method ..
good luck |
There can be issues. At times, a page sets cookies with certain variables and include them in the submit process. Also, you have to be very clear what name the SITE gives for the form and use that, it must be specific and if it is a Linux server, it may be case sensitive as well.
It may be easier for you to display the page in NB and then to a series of simulated keystrokes to enter the data and click the submit/login button.
David P |
|
| Back to top |
|
 |
|