faustf

_ie problem slow

14 posts in this topic

hi guys i have problem with a site

i try to switch 3 combobox, the script  work  but the  focussed a combobox happens after  15 min of clock how is possible  that ???

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 1, 1)
_IELoadWait($oIE)

Local $oForm2 = _IEFormGetCollection($oIE, 0)
    ;MsgBox($MB_SYSTEMMODAL, "Forms Info", "There are " & @extended & " form(s) on this page")
For $oForm In $oForm2
  ConsoleWrite( $oForm.name & @CRLF)
  $name=String( $oForm.name())

  If $name = "n" Then
      _IEAction($oForm, "Focus")

  EndIf

Next

i tryed also remove _ieloadwait($oie), but nothing

 

Share this post


Link to post
Share on other sites



You can do something like this.

 

#include <IE.au3>
#include <MsgBoxConstants.au3>

_IEErrorHandlerRegister()
Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 0, 1)


Local $oButton=0
;Wait Till Button Generate is valid
While Sleep(30)
    $oButton=_IEGetObjById($oIE,"genbtn") ;you can wait for another element if is needed
    If IsObj($oButton) Then ExitLoop
WEnd


Local $oForm = _IEFormGetCollection($oIE, 0)
Local $oSelect1 = _IEFormElementGetObjByName($oForm, "gen")
Local $oSelect2 = _IEFormElementGetObjByName($oForm, "n")
Local $oSelect3 = _IEFormElementGetObjByName($oForm, "c")

_IEFormElementOptionSelect($oSelect1, "male", 1, "byValue")
_IEFormElementOptionSelect($oSelect2, "ninja", 1, "byValue")
_IEFormElementOptionSelect($oSelect3, "sp", 1, "byValue")

Saludos

1 person likes this

Share this post


Link to post
Share on other sites

thankz  work great  but  why my  old  script  is to slow??

 

Share this post


Link to post
Share on other sites

I really did not check deeply. Some month ago I got that similar issue but just handled it using the way I posted above.

 

Saludos

Share this post


Link to post
Share on other sites

ha  thankz  :)  again

Share this post


Link to post
Share on other sites

sorry other little bit questions , you  wait a button , because you know before of the button exist/or not the checkbox???

i understund good??

thankz

Local $oButton=0
;Wait Till Button Generate is valid
While Sleep(30)
    $oButton=_IEGetObjById($oIE,"genbtn") ;you can wait for another element if is needed
    If IsObj($oButton) Then ExitLoop
WEnd

 

Share this post


Link to post
Share on other sites

I just wait for button beucase you I thought that you will press it then for generate the fakename (it submit the form for generating the names). But you can wait other controls you want/need.

 

Saludos

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Eureka  i find  the problem
 , i think  is  "Bug"  of _IECreate   when you set
 the script in this mode

Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 1, 1)

active option loadpage , and stay in loading much time , i don't know  why , because  the page is just arrive at end loading  and  we continue to  wait , but  if  you use  this

Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 0, 1)

work perfectly, if  some one , can expleain much better if is bug or simply my  bad programmation , is  welcome  :)

thankz at all again

and  also i have  thesame  slow "Error" also if  use  this code

_IEErrorHandlerRegister()
Local $oIE = _IECreate("http://fakenamegenerator.com/" , 0, 1, 0, 1)
_IELoadWait($oIE)

 

Edited by faustf

Share this post


Link to post
Share on other sites

It's probably due to _IELoadWait, it's not always the best method to use with IE to determine if a page has finished loading.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#10 ·  Posted

agree , but  how  is  best metod  for you ??

Share this post


Link to post
Share on other sites

#11 ·  Posted

No. It is not a bug. It more something internally in the website. Beucase some time ago when I check It was not loading. now it load faster using this flags _IECreate("http://fakenamegenerator.com/", 0, 1, 1, 1)

as @BrewManNH says. sometimes  _IELoadWait  is not the best way to handle that.

 

Saludos

Share this post


Link to post
Share on other sites

#12 ·  Posted

The best method would be to look for an element on the page to see if it exists yet or not, other than that, you're going to be going in blindfolded.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

9 minutes ago, faustf said:

agree , but  how  is  best metod  for you ??

 

I think this question is too irrelevant. Of course a programmer will  choose the documented common way, because it's the way things should be. But If you've been programming for some time(you've already)  you should know that programmers fight with issues like that every day. :drool:

 

Saludos

 

 

Edited by Danyfirex
typo

Share this post


Link to post
Share on other sites

#14 ·  Posted

other this not exist   mode  to understund  if page is load ??, because if page is dinamically or  after some  month is changed is very frustrating

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now