Website Login

Just starting out? Need help? Post your questions and find answers here.
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

Website Login

Post by Vitor_Boss® »

I'm building a kind of a auto-cliker program and didn't found any working code. Can someone help or show me where find this?

Thank you in advance.
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Website Login

Post by luis »

If it's ok for you to use the webgadget, try to look at this code for some ideas.

http://www.purebasic.fr/english/viewtop ... 09#p350209
"Have you tried turning it off and on again ?"
A little PureBasic review
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

Re: Website Login

Post by Vitor_Boss® »

Thank you, that is a perfect start. I had modify your function to improve your code.

Code: Select all

Procedure WebGadget_SetFieldText (nGadget, sFieldName.s, sValue.s)
  Protected sScript.s
  ;sScript = "document." +sForm + "." + sFieldName + ".value = " + sValue + ";"
  
  sScript = "var elements = document.getElementsByName('"+ sFieldName + "');"
  sScript + "for (var i = 0; i < elements.length; ++i)"
  sScript + "{"
  sScript + "if (elements[i].tagName.toLowerCase() == 'input')"
  sScript + "{"
  sScript + "elements[i].value='" + sValue + "';"
  sScript + "break;"
  sScript + "}"
  sScript + "}"
  
  WebGadget_ExecScript (nGadget, sScript)
EndProcedure
Last edited by Vitor_Boss® on Sun Jan 29, 2012 1:05 am, edited 1 time in total.
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Website Login

Post by luis »

Thank you for letting me know.

Yes, using javascript *you* can write many useful functions to expand that code.

Just not myself because I'm not very fluent in JS !
"Have you tried turning it off and on again ?"
A little PureBasic review
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

Re: Website Login

Post by Vitor_Boss® »

Sorry about that, I don't know expressions in English. What I mean is "I had modify your code to improve the login page".

Thank you very much. And I'm not a JS programmer too.
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
Post Reply