Jump to content

Recommended Posts

Posted

I have a script that makes use of the _IE functions to open a new Internet Explorer window and navigate to a URL provided by the use, at which point it edits and saves some information on the page. When I run the script and have it execute the code to do the above a new window is being created successfully, but then sometimes the Windows Explorer tab says "Waiting for X.X.X.X" The Xs are stand ins for numbers, such as: 2.0.0.80, 2.0.0.86, and 2.0.0.2. Eventually the window will close, but without ever actually navigating to the URL provided.

After closing the script, restarting it, and following all of the same steps above, the script will now work correctly and navigate to the page. Essentially when this happens I'm having to go through the process of setting everything up twice for it to work.

Any thoughts on what might be causing this?

Posted
  On 10/6/2016 at 10:28 AM, AutoBert said:

Some bugs in your script. Can you navigate to the urls i manualy in a browser?

Expand  

Yes, I can navigate to the URLs manually. Note too that this doesn't happen all the time. Every now and then I can start the script, enter a URL, and it'll work perfectly fine the first time around. I've updated my post with the relevant code sections.

  On 10/6/2016 at 10:30 AM, Danp2 said:

This... or maybe some kind of proxy that is in place. No way to know with the limited information supplied.

Expand  

Besides the code in my original post, what additional information would be useful in a situation like this?

Posted

Just kidding about the code being added to my original post, thought editing was available on the forum. Here's the relevant code.

Section where the IE window is created and where the function is called to navigate:

$oIE = _IECreate()

$iItemToUpdateCounter = 1
$bUpdatesWereSuccessful = True
While $iItemToUpdateCounter < _UBound($g_aItemsToUpdate) And $bUpdatesWereSuccessful = True
  $bUpdatesWereSuccessful = Call(_UpdateItemPricesOnWebsite, $oIE, $iItemToUpdateCounter)
  $iItemToUpdateCounter += 3
WEnd

_IEQuit($oIE)

Function that handles navigating to the webpage and then making the updates.

Func _UpdateItemPricesOnWebsite($oIE, $iItemToUpdateCounter)
    _IENavigate($oIE, $g_aItemsToUpdate[$iItemToUpdateCounter])
    $iEditImagesInPage = Call(_GetCountOfImagesInPageWithSRC, $oIE, $g_sEditImageSRC) - 1

    if $iEditImagesInPage > 0 Then
        For $iIndex = 0 To $iEditImagesInPage
            _IEImgClick($oIE, $g_sEditImageSRC, "src", $iIndex)

            $oForm = _IEGetObjByName($oIE, $g_sPricesFormName)
            $oElement = _IEFormElementGetObjByName($oForm, $g_sEStorePriceElementName)
            _IEFormElementSetValue($oElement, $g_aItemsToUpdate[$iItemToUpdateCounter + 1])
            $oElement = _IEFormElementGetObjByName($oForm, $g_sBulkPriceElementName)
            _IEFormElementSetValue($oElement, $g_aItemsToUpdate[$iItemToUpdateCounter + 2])
            $oObject = _IEGetObjByName($oForm, "submit")
            _IEAction($oObject, "click")

            _IELoadWait($oIE)
        Next

        Return True
    Else
        Return False
    EndIf
EndFunc   ;==>_UpdateItemPricesOnWebsite

 

Posted
  On 10/6/2016 at 10:25 AM, Vartib said:

sometimes the Windows Explorer tab says "Waiting for X.X.X.X" The Xs are stand ins for numbers, such as: 2.0.0.80, 2.0.0.86, and 2.0.0.2. Eventually the window will close, but without ever actually navigating to the URL provided.

Expand  

These are the IP addresses for the destination site, correct?

  Quote

After closing the script, restarting it, and following all of the same steps above, the script will now work correctly and navigate to the page. Essentially when this happens I'm having to go through the process of setting everything up twice for it to work.

Any thoughts on what might be causing this?

Expand  

If the _IENavigate fails, _UpdateItemPricesOnWebsite returns False and the calling routine with exit prematurely. I would suggest that you add some error checking. Also, run the script in Scite and post the results shown in the Output window from a failed attempt.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...