Setup HTML does not work

Let us know if anything goes wrong with our baby :)
Post Reply
pascal
Posts: 3
Joined: Fri Nov 18, 2011 12:42 pm

Setup HTML does not work

Post by pascal » Thu Dec 01, 2011 1:58 pm

Hi again, Juan

I have imported a premade to enter automatically user and password. The project is called autologin, and is available in the premade menu in version 2.2.5.
Without touching anything, this project does not work, for some obscure reason, the setup html page does not show up, so the javascript then cannot find the user and password data. I tried to see what was wrong, but did not notice anything in the HTML code.
Regarding the javascript code, on the opposite, I find it a little complex.
As the userBoxKind and passBoxKind are supposed to exist and be unique throughout the project, then what is the use of complicating things in allowing other kind names ?
Anyway, I'm not asking you to solve this, the issue concerning Helium scraper is : why is the setup html page not displayed upon project start up ?
Hope you can reproduce this on your side. I have attached the html code that comes with the premade here after for your convenience.

Best regards.
Pascal.

<html>
<head>
<style type="text/css">
#topDiv
{
position:absolute;
/* Helium Scraper will adjust the size of the displayed page to this size */
width:287px;
height:103px;
z-index:1;
background-color: buttonface;
padding: 8px;
}
body
{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</style>
<script type="text/javascript">
function addOption(selectbox, text, value)
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}

function OnLoad()
{
var kindNames = window.external.KindNames();

var username = document.getElementById("username");
var password = document.getElementById("password");
var userBoxKind = document.getElementById("userBoxKind");
var passBoxKind = document.getElementById("passBoxKind");

for(k = 0; k < kindNames.length; k++)
{
addOption(userBoxKind, kindNames[k], kindNames[k]);
addOption(passBoxKind, kindNames[k], kindNames[k]);
}


if(window.external.ParamsSet)
{
userBoxKind.value = window.external.GetParam("userBoxKind");
passBoxKind.value = window.external.GetParam("passBoxKind");
username.value = window.external.GetParam("username");
password.value = window.external.GetParam("password");
}
}
</script>
</head>

<body onLoad="OnLoad()">
<div id="topDiv">
<form action="http://www.do-not-change-this.com" method="get" id="mainForm">
<!-- Place all your content here -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>User Box:</td>
<td><select name="userBoxKind" id="userBoxKind">
</select></td>
</tr>
<tr>
<td>Pass Box:</td>
<td><select name="passBoxKind" id="passBoxKind">
</select></td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" name="username" id="username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="text" name="password" id="password"></td>
</tr>
</table>
</form>
</div>
</body>
</html>

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Setup HTML does not work

Post by webmaster » Thu Dec 01, 2011 5:14 pm

Hi Pascal,

You don't need to worry about the HTML Setup code at all. Simply create a kind that selects the username box and another that selects the password box, then import the project from the New Action -> Execute Actions Tree -> More... menu in any actions tree, and assign your kinds, username and password in the screen that will popup.

If you have already imported this project then you should be able to use it from New Action -> Execute Actions Tree -> Auto login. The Setup HTML code is just the code for the screen that pops up when you add or double click this action.

You would also need to add a kind that selects the "Submit" button and use a Navigate action that simulates click on it right after your Auto login action.
Juan Soldi
The Helium Scraper Team

Rich
Posts: 8
Joined: Fri Feb 10, 2012 8:54 am

Re: Setup HTML does not work

Post by Rich » Fri Feb 10, 2012 8:59 am

Juan,

I've followed your notes above, but cannot get the password and username to set. Can you confirm where I should be setting these? I've created the username, password and navigate kinds, but get a pop up that I've not set the values.

Many thanks,

Richard

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Setup HTML does not work

Post by webmaster » Sat Feb 11, 2012 3:29 am

Hi,

Please follow the steps below and let me know if you have any problem. If so, I'll need to look at the URL to see what's going on.
  1. Create a new project and navigate to your login page.
  2. Create a kind for the INPUT element where you'd enter your username and call it Username.
  3. Create a kind for the INPUT element where you'd enter your password and call it Password.
  4. Go to Actions tree 1, click on New action -> Execute Actions Tree -> More....
  5. Select Auto login and click on Import.
  6. On the next dialog, select the Username and Password kinds, type your username and password and click OK.
  7. Run Actions tree 1.
Juan Soldi
The Helium Scraper Team

Rich
Posts: 8
Joined: Fri Feb 10, 2012 8:54 am

Re: Setup HTML does not work

Post by Rich » Sat Feb 11, 2012 7:46 am

Fantastic, thank you.

Richard

Post Reply