NeoSoft Support Forum Forum Index  Your source for Plug-Ins, sample publications, source code and more...

Source Language:
Translate to:

NeoSoft Support Forum
NeoSoft Community Support Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   SmartFeedSmartFeed   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Browser setElement

 
Post new topic   printer-friendly view   Reply to topic    NeoSoft Support Forum Forum Index -> NeoBook Action Commands
View previous topic :: View next topic  
Author Message
Luke
NeoBooker


Joined: 17 Nov 2005
Posts: 35

PostPosted: Wed Oct 04, 2006 7:32 am    Post subject: Browser setElement Reply with quote

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
View user's profile Send private message
Neosoft Support
NeoSoft Team


Joined: 31 Mar 2005
Posts: 4048
Location: Oregon, USA

PostPosted: Wed Oct 04, 2006 10:42 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Gaev
NeoBooker


Joined: 01 Apr 2005
Posts: 4321
Location: Toronto, Canada

PostPosted: Wed Oct 04, 2006 11:02 am    Post subject: Reply with quote

Luke:

If your form has an "Id" e.g ....
Code:
<form id="myForm" etc. etc. ....>
... then you can send the following via BrowserExecScript ...
Code:
document.getElementById("myForm").submit()

This was previously discussed here ... http://www.neosoftware.com/forum/viewtopic.php?t=14238&highlight=form+submit
_________________
Gaev
http://www.scriptedlogic.com/
Back to top
View user's profile Send private message Visit poster's website
Abdullah
NeoBooker


Joined: 10 Mar 2009
Posts: 60
Location: Palestine

PostPosted: Tue Jan 26, 2010 1:04 pm    Post subject: Reply with quote

mmm , very interesting post

understand the logic but Embarassed 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 Rolling Eyes

i am playing now how to do that , mm if anybody can give me an example for this , will be welcomed Smile

thanks
_________________
Abdullah
Back to top
View user's profile Send private message Send e-mail
Abdullah
NeoBooker


Joined: 10 Mar 2009
Posts: 60
Location: Palestine

PostPosted: Tue Jan 26, 2010 1:23 pm    Post subject: Reply with quote

my code is

Code:
SetVar "[WebBrowser2Addr]" "..."
BrowserSetElement "WebBrowser2" "Name" "...."
BrowserSetElement "WebBrowser2" "Password" "...."
BrowserExecScript "WebBrowser2" "document.getElementById([#34]Enter[#34]).click()" "JScript"


with no success Sad
_________________
Abdullah
Back to top
View user's profile Send private message Send e-mail
Neosoft Support
NeoSoft Team


Joined: 31 Mar 2005
Posts: 4048
Location: Oregon, USA

PostPosted: Tue Jan 26, 2010 2:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Abdullah
NeoBooker


Joined: 10 Mar 2009
Posts: 60
Location: Palestine

PostPosted: Thu Jan 28, 2010 3:52 pm    Post subject: Reply with quote

Hello Neosoft,

thanks for your reply , but i tried that before i post my first reply here with no luck Sad

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
View user's profile Send private message Send e-mail
Neosoft Support
NeoSoft Team


Joined: 31 Mar 2005
Posts: 4048
Location: Oregon, USA

PostPosted: Fri Jan 29, 2010 11:53 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Abdullah
NeoBooker


Joined: 10 Mar 2009
Posts: 60
Location: Palestine

PostPosted: Sat Jan 30, 2010 1:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Gaev
NeoBooker


Joined: 01 Apr 2005
Posts: 4321
Location: Toronto, Canada

PostPosted: Sat Jan 30, 2010 9:05 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
dpayer
NeoBooker


Joined: 11 Apr 2005
Posts: 890

PostPosted: Sun Jan 31, 2010 12:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    NeoSoft Support Forum Forum Index -> NeoBook Action Commands All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Forum content © 2008 NeoSoft Corp. All rights reserved.