Help with automator to open web page within safari and then input text

All:

I am relatively new to the mac world and automator and need help with creating automator to open a web page within safari and then input specific text into 2 input fields. I have been able to open the web page in safari but am stuck on how to get specified text inputed into fields within the web page and then click a login button.

Thanks for any help and happy new year

JCB

I believe the only way to do this is with JavaScript.

Here is an AppleScript solution that you can add to your
Automator workflow.

You will need to find out what the form element names are and what values they
expect and make the appropriate changes to the script below.

If you use FireFox there is a great plugin called “Web Developer”
you can get it here - https://addons.mozilla.org/en-US/firefox/addon/60

It has a drop down menu item called “Forms” that will give you the info you need.


set homePage to "your/url/here"

set jav to "document.form1.login_name.value='your_value';
document.form1.login_pass.value='your_pass';
document.form1.login.click();"

tell application "Safari"
	
	--load your page here
	tell document 1
		set URL to homePage
		
		--do JavaScript code
		do JavaScript jav
		
	end tell
end tell

Good luck!
Craig