Jump to content
Sign in to follow this  
jerem488

Problem with the loop _ienavigate()

Recommended Posts

Hi all,

I have an array with many URLs. I want parse this URLs with _ienavigate and it stop at the 2nd URL without error...

I tested _IELoadWaitTimeout(), the problem is still present.

 

Res()
Func Res()
    Local $o_IE = _IECreate("about:blanck", 0);, 0)
    Local $aURLs[5] = ["http://www.tennisendirect.net/atp/match/janko-tipsarevic-VS-radu-albot/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/grigor-dimitrov-VS-steve-johnson/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/cedrik-marcel-stebe-VS-soon-woo-kwon/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/taro-taro-VS-tennys-sandgren/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/gregoire-barrere-VS-cameron-norrie/abierto-mexicano-de-tenis-mifel-los-cabos-2019/"]
    For $aURL In $aURLs
        ConsoleWrite($aURL & @LF)

        _IENavigate($o_IE, $aURL)
    Next
EndFunc

Thanks


Qui ose gagneWho Dares Win[left]CyberExploit[/left]

Share this post


Link to post
Share on other sites

It works well for me even without _IELoadWait($o_IE).

Try this version with MsgBox to check whether it loads. If it does, I would do a Do Sleep / Until a specific element common to all the pages is found.

#include <IE.au3>

Res()
Func Res()
    Local $o_IE = _IECreate("about:blanck", 0);, 0)
    Local $aURLs[5] = ["http://www.tennisendirect.net/atp/match/janko-tipsarevic-VS-radu-albot/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/grigor-dimitrov-VS-steve-johnson/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/cedrik-marcel-stebe-VS-soon-woo-kwon/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/taro-taro-VS-tennys-sandgren/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/gregoire-barrere-VS-cameron-norrie/abierto-mexicano-de-tenis-mifel-los-cabos-2019/"]
    For $aURL In $aURLs
        ConsoleWrite($aURL & @LF)

        _IENavigate($o_IE, $aURL)
        _IELoadWait($o_IE)
        MsgBox(1, "Loaded", "URL '" & $aURL & "' was loaded successfully.")
    Next
EndFunc

 

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

@jerem488, as Nine asked - do you use the latest version of AutoIt? Is there any more code in your script? If so, post it.

Also, try this and report back:

#include <IE.au3>

Res()
Func Res()
    Local $o_IE = _IECreate("about:blanck", 0);, 0)
    Local $aURLs[5] = ["http://www.tennisendirect.net/atp/match/janko-tipsarevic-VS-radu-albot/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/grigor-dimitrov-VS-steve-johnson/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/cedrik-marcel-stebe-VS-soon-woo-kwon/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/taro-taro-VS-tennys-sandgren/abierto-mexicano-de-tenis-mifel-los-cabos-2019/", _
        "http://www.tennisendirect.net/atp/match/gregoire-barrere-VS-cameron-norrie/abierto-mexicano-de-tenis-mifel-los-cabos-2019/"]
    For $aURL In $aURLs
        ConsoleWrite($aURL & @LF)

        _IENavigate($o_IE, $aURL)
        If @error Then
            MsgBox(16, "_IENavigate Error", "Failed to navigate to URL '" & $aURL & "' - error " & @error)
        EndIf
        
        _IELoadWait($o_IE)
        If @error Then
            MsgBox(16, "_IELoadWait Error", "Failed to load wait to URL '" & $aURL & "' - error " & @error)
        EndIf
    Next
EndFunc

 

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...