Jump to content
UBot Underground

Script Error - Socket Not Ready For Send/recv


Recommended Posts

I am trying to connect to my gmail account, loop through the emails, and scrape certain links from each email.  Everything seems to be working fine up until the line where it deletes the email after the "add list to list" command.  I am getting an error that says:

 

"Script Error  Error: Socket not ready for send/recv"

"Source: > torontomls > connect to mail server > loop > if > then > delete mail"

 

When I step through the code and look at the debugger I can see that the "add list to list" command actually works, so I know the code is making it that far.  I can also see that the "delete email(#pos)" command is also working because the message has been deleted from the inbox.  

 

I just don't understand why I am receiving the error.  I have attached a screenshot of the error.  Any ideas what might be going wrong?  Thanks.

 connect to mail server("IMAP With SSL", "myaccount@gmail.com", "mypassword", "imap.gmail.com", 993) {    create table from emails(&emails)
    set(#pos, 0, "Global")
    loop($table total rows(&emails)) {
        if($comparison($email subject(#pos), "=", "Toronto Real Estate Sold")) {
            then {
                load html($email body html(#pos))
                wait(1)
                add list to list(%links to areas, $scrape attribute(<href=w"http://v3.torontomls.net/Live/Pages/Public/Link.aspx?Key=*">, "fullhref"), "Delete", "Global")
                delete email(#pos)
            }
        }
        increment(#pos)
    }
    append to file("C:\\bestmacros\\TorontoMLS links.txt", "{%links to areas}{$new line}", "End")
}

post-15092-0-32528400-1437057542_thumb.png

Link to post
Share on other sites

So basically your trying to:

 

  • connect to gmail
  • check if "Toronto Real Estate Sold" is in the subject line
  • if it exist load email & scrape attribute
  • delete email
  • and continue to check rest of emails?

 

Try this buddy..
 

connect to mail server("IMAP With SSL", "myaccount@gmail.com", "mypassword", "imap.gmail.com", 993) {
    create table from emails(&emails)
    set(#pos, 0, "Global")
    loop($table total rows(&emails)) {
        set(#emailbody, $email body html(4), "Global")
        load html(#emailbody)
    if($exists(<innertext="Toronto Real Estate Sold">)) {
            then {
                wait(1)
                add list to list(%links to areas, $scrape attribute(<href=w"http://v3.torontomls.net/Live/Pages/Public/Link.aspx?Key=*">, "fullhref"), "Delete", "Global")
                delete email(#pos)
            }
        }
        increment(#pos)
    }
    append to file("C:\\bestmacros\\TorontoMLS links.txt", "{%links to areas}{$new line}", "End")
}

Only gmail account I have has so much auth protection on it i was not able to test this for you.
So you might have to edit the :

set(#emailbody, $email body html(4), "Global")

where it says "$email body html(4)" You may need to change the (4) depending on gmail.
It's setup for mail.ru rite now.

Hope this helps, if not please let me know.
I would be able to help more with a gmail account for testing.

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...