Jump to content
UBot Underground

Error When Using Headless, Exceeded The Range Of The List


Recommended Posts

I have written a bot that uses a list to go through a UI Block Text, shortens the input and then outputs to a different list. The problem I am having, is that the list that gets updated to, keeps returning an error and stopping the script when in headless mode.

        wait(1)
        type text(<url field>,#currentlongurl,"Standard")
        wait(1)
        click(<login button>,"Left Click","No")
        wait(1)
        add list to list(%shorturls,$scrape attribute(<class="short-url">,"href"),"Delete","Global")
        set(#currentshorturl,$next list item(%shorturls),"Global")
        increment(#currentshorturl)
        wait(1)

The script error that this creates (only when using headless), is: "you have exceeded the range of the list" $next list item(%shorturls) -> $next list item(%shorturls) -> $next list item"

 

I don't understand what I have done wrong, it works fine when not using headless browser. What am I doing wrong here?

Link to post
Share on other sites

make sure you enable javascript inside in the headerless browser,also you have a 1 second wait after clicking a login button,maybe the page hasnt loaded,so use a wait for browser event instead

 

but I think its not enabling javascript in the headless browser is the problem

  • Like 1
Link to post
Share on other sites

make sure you enable javascript inside in the headerless browser,also you have a 1 second wait after clicking a login button,maybe the page hasnt loaded,so use a wait for browser event instead

 

but I think its not enabling javascript in the headless browser is the problem

Thank you, but no it didn't work. As for the wait, prior to those commands I listed, I have a "wait for browser event". I think it has something to do with the list code. :(

Link to post
Share on other sites

I don't understand? How do I check the list count?

Because you run it out of there.

You need to check the total.

For example

The actual number is 5 or 5 positions.

But you want to position 10

So there error "Exceeded The Range Of The List"

  • Like 1
Link to post
Share on other sites

best practice is to count total first, then do iteration ($next list item)

 

you stated that this error occurs when using headless feature, isnt ?

add list to list(%shorturls,$scrape attribute(<class="short-url">,"href"),"Delete","Global")

then maybe, when using headless feature ubot failed to scrape data. Check you list if its empty

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...