Randomly getting Error 1300, -silent mode, and avoiding DS

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Lightja
Posts: 20
Joined: Tue Aug 30, 2016 3:40 am

Randomly getting Error 1300, -silent mode, and avoiding DS

Post by Lightja » Tue Aug 30, 2016 3:56 am

So my problems are:

1. Avoiding using DS, both for mouse clicks and interacting with elements that don't record (e.g unfollow button for tumblr, or adding multiple tags to a post)
2. randomly failing with error 1300 "Cannot find HTML element of type "some element". The element it fails on is always the same, until I change the code, then it can change to a new element that was never problematic before.
3. randomly failing with the above error MORE often in -silent mode

=========================================================================================================================================================================
More Info:

I'm new-ish to iMacros, but as a programmer I have a decent understanding from the beginning. I've been able to automate a good # of tasks, but every now and then I run into an issue. Usually I go to DirectScreen click mode to record as a last resort so that I can have the actual clicks carry out the task, but ideally I'd like to avoid this whenever possible.

So far I'm trying to automate Tumblr. Including posting photos, linking them to a site, adding tags, adding a description, following people, liking photos, etc.

The first problem comes from the main macro I'm working, which is intended to add 50 posts to my Tumblr queue, all in one macro. It's a large macro, but I want something large to start with so that I can have something robust, then I know smaller macros will be no problem. Uploading one, or even multiple, is no problem, but occasionally I get a random error 1300 (Could not find HTML Element...). It could be on the 5th upload, 20th, or 49th. I've tried increasing TIMOUT_STEP to as high as 30, but this had no effect. I changed REPLAYSPEED to medium/slow, and this helped slightly, but the issue still persists. Is expecting it to get through all 50 posts every time without ever encountering such an error just unrealistic expectations, or is there something I'm doing wrong?

The second problem is that when operating in -silent mode, these random errors occur more often / earlier than in non-silent mode. Any ideas why this is? Maybe this helps give you an idea of why I'm getting them in the first place? Or is this to be expected?

Regarding DS, the first, simpler task I automated with DirectScreen (because I couldn't automate it without DS), is to simply go to https://www.tumblr.com/following and press the unfollow button for a few people near the top. Super simple, just consists of pressing a button, but recording never picked anything up. The second, more complicated DS task is adding tags to an image I'm uploading. I managed to get both working with DirectScreen, but I can't imagine this isn't doable some other way. Would appreciate any advice on how to avoid using DS and interact with these elements manually, even though the recorder doesn't pick anything up. Should I still try to do this via TAG? Or some other command?

Info about my system:
Version 10
Windows 10
iMacros Browser v10 (also having issues trying it in chrome)
Last edited by Lightja on Thu Sep 01, 2016 10:06 pm, edited 8 times in total.
Latest System Information:
iMacros 11.1
Windows 10 Enterprise
Firefox v48.0.2 - iMacros for Firefox v8.9.7
Chrome v53.0.2785.89 - iMacros for Chrome v8.4.4
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: General iM newb Qs, avoiding DS and silent mode

Post by iimfun » Tue Aug 30, 2016 2:41 pm

I don't work with iMacros Browser but have the following macro that adds tags on Tumblr posts in iMacros for Chrome

Code: Select all

EVENT TYPE=CLICK SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV>DIV>DIV" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV>DIV>DIV" CHARS="first tag"
EVENT TYPE=CLICK SELECTOR=*
WAIT SECONDS=1

EVENT TYPE=CLICK SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV>DIV>DIV" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#new_post_buttons>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV>DIV>DIV" CHARS="second tag"
EVENT TYPE=CLICK SELECTOR=*
WAIT SECONDS=1

' etc.
Perhaps it will be helpful to you.
Lightja
Posts: 20
Joined: Tue Aug 30, 2016 3:40 am

Re: General iM newb Qs, avoiding DS and silent mode

Post by Lightja » Tue Aug 30, 2016 9:16 pm

Thanks for that, I'll be sure to try it out. Pretty sure if it works in chrome it'll work in the imacros browser. Would love to know more about how you made this macro because it looks completely foreign to me, especially with all the DIV> on one line. I feel like understanding it would help me a lot. EDIT: it works in chrome, but for some reason it says "unknown command: event" in the imacros browser, but I'm not sure why because imacros browser should support the EVENT command... I looked into how your code works, and I think I understand the 'DIV>DIV>DIV' stuff, which helps me target specific elements that I want to interact with, I just need to be able to apply it to other commands.

By the way, in case anyone wants to see the macro, it's here: http://pastebin.com/6d7dUSzg

it always fails on the same line:
Error -1300: Macro: TumblrQueue50.iim, line 141. (-1300) Cannot find HTML element of type "INPUT:FILE" with attribute(s) "NAME:photo".

It's always Error 1300 (Cannot find HTML element), and it's always the same element. However, when I make changes to the code (for example I changed it from clicking the suggested tag button to just pressing {ENTER} since I was already using DS anyways), the specific HTML element can change. Previously it was failing on pressing the suggested tag button only. Then it was failing on "Cannot find HTML element of type "DIV:" with attribute(s) "CLASS:editor editor-plaintext&&ARIA-LABEL:Post tags&&CONTENTEDITABLE:true". After that, I changed that line to the much simpler "TAG POS=3 TYPE=DIV ATTR=TXT:​" and now it's failing on "TAG POS=1 TYPE=INPUT:FILE ATTR=NAME:photo CONTENT=C:\Users\PC\Desktop\SPImgs\TumblrQs\1.jpg" I just can't win. Even though these weren't problematic lines before, now they're the only lines causing trouble.
"
Latest System Information:
iMacros 11.1
Windows 10 Enterprise
Firefox v48.0.2 - iMacros for Firefox v8.9.7
Chrome v53.0.2785.89 - iMacros for Chrome v8.4.4
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: Randomly getting Error 1300, -silent mode, and avoiding

Post by iimfun » Wed Aug 31, 2016 6:43 am

The mentioned above macro was recorded with Experimental event recording mode.

In brief, I would recommend you applying the free iMacros for Firefox extension (and its JavaScript Scripting Interface for more functional codes). I think that it'll be no problem for you to write a js script (or an iim macro - what you prefer more) for Tumblr posting like I did it once.

BTW, it's impossible to upload files in iMacros for Chrome
Error: Sorry, upload functionality is currently not supported in iMacros for Chrome.
chivracq
Posts: 8790
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Randomly getting Error 1300, -silent mode, and avoiding

Post by chivracq » Wed Aug 31, 2016 1:11 pm

Hum, interesting Case, I will share a few "Thoughts", in "chronological" Order I think...

@Lightja, your OP was perfect with Descriptive Thread Title (even if you changed it later on once you solved the first part, which makes that it doesn't reflect now the whole/original Content of the Thread, but never mind...), FCI mentioned, URL mentioned even if hum, Script was missing, but I don't have a 'tumblr' Account so I can't have a Look, but be careful with silent EDITs to your Posts, especially when opening a new Thread. I usually notice new Posts/Threads fairly quickly but I normally only check them once and I wouldn't have noticed your EDIT to your OP if @iimfun had not reacted to your Thread... (Even if in your Case, it didn't change much as I cannot really help with this Site..., and like @iimfun, I don't use the iMB, only/mostly iMacros for FF, so I cannot do any Testing regarding the DS Mode..., nor the '-silent' Mode...)

Posting your Script on some external Site is not very practical I find, while you can embed it directly in your Post with the ']CODE[' Tags, unless locating Line_140 in your Script is really a hassle or if you hit the 64Kb Size Limit for a Post if your Script is very-very large, but then you could post both, the truncated relevant part embedded in the Post and the whole Script on 'pastebin'...

Then yep, the Script that @iimfun's posted is using the EVENT Mode which is not supported by iMB10 which is the Browser (Version) you are using from your FCI. You would need to upgrade to iMB11 where the EVENT Mode got implemented (as well) or use IE11 with iMacros for IE v11, or iMacros for FF v8.x or v9.x, or iMacros for CR v8.8.4 where it got implemented as well.

BUT...!, like @iimfun mentions, you hit some more Limitations, not all Commands are indeed implemented for all Browsers/Versions..., and File Upload is indeed not supported by iMacros for CR. And this Functionality got dropped as well recently in the v9.x Line (Current (Latest) Version is v9.0.3) of iMacros for FF, so you would have to make sure that you install and use iMacros for FF v8.9.7 (+FF47/48) if you want to follow @iimfun's Advice... (and be able to do some File Upload in your Script...!).

EDIT: "for all Browsers/Browsers" = "for all Browsers/Versions", ah-ah...! (Corrected.)
Last edited by chivracq on Fri Sep 02, 2016 2:27 pm, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 8790
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Randomly getting Error 1300, -silent mode, and avoiding

Post by chivracq » Thu Sep 01, 2016 4:46 pm

Lightja wrote:EDIT: I've made lots of edits to this post as I've figured things out, but there have been some pervasive issues, which include:
1. Avoiding using DS, both for mouse clicks and interacting with elements that don't record well (e.g unfollow button for tumblr, or adding multiple tags to a post)
2. randomly failing with error 1300 "Cannot find HTML element of type "some element". The element it fails on is always the same, until I change the code, then it can change to a new element that was never problematic before.
3. randomly failing with the above error MORE often in -silent mode
4. Just go straight to my first reply, and you can read the original post if you need more information. Check out the macro here: http://pastebin.com/6d7dUSzg


=========================================================================================================================================================================


I'm new-ish to iMacros, but as a programmer I have a decent understanding from the beginning. I've been able to automate a good # of tasks, but every now and then I run into an issue. Usually I go to DirectScreen click mode to record so that I can have the actual clicks carry out the task, but ideally I'd like to avoid this whenever possible.

So far I'm trying to automate Tumblr.

So the first, simpler problem, which I did solve with DirectScreen, but would like to do without (because it's most likely possible), is to simply go to https://www.tumblr.com/following and press the unfollow button for a few people near the top. Super simple, just consists of pressing a button, but recording never picked anything up. I managed to get it to work with DirectScreen, but I can't imagine this isn't doable some other way.

The other, slightly more complicated problem, is to add tags to an image. So I go to https://www.tumblr.com/new/photo, pick an image (works), set the image URL (works), then add tags. Once again, I managed to do this with DirectScreen, but since the images are of varying heights, the click positions only work for images of the same height.

This is a common problem I run into, there's a simple element that I have trouble interacting with, usually a simple button or text field, usually because record doesn't work well with that type of image/element. I think I need a bit more technical expertise to be able to handle them regularly, but I don't really know where to look. If you can help me with these specific problems, that'd be great! However, if you can show me some information I should be applying to these situations so that I can better solve them in the future, that'd be much better. I think I need to be writing the macros for these elements manually, but I just don't know how yet. I understand programming, but am very new to the .iim language so I primarily rely on what record can provide me with.

right now, while part waiting for a response, and part continuing to try and figure it out, I'm just inspecting the page's html code to try and extrapolate the meaning of the code, reading about functions like TAB to understand exactly what they're doing, and learning things like what "pos=5" means exactly, and what it's relative to.

EDIT: I managed to get adding tags to work by emulating the clicking the recommended tag that pops up. Previously I was able to select the area for the first tag, type it up using DS, then I wasn't able to get to the next tag. Now, what I do is type out the tag, then emulate the clicking of the recommended tags that pop up, and once you click on them, it automatically puts you on the next tag. Still though, doing it without clicking the recommended tabs that pop up seems possible, and while it's not necessary to automate this task without DS like I needed, it's something I'd still like to learn. Same with unfollowing, I should be able to do that without DS. Similarly, I am not able to automate adding tags without DS, except now I'm just using it for keyboard input rather than clicks, which wont be affected by varying image heights. Doing the keyboard input without DS should be easy I'd imagine. So even though I've solved my main issue, I'd still appreciate any advice anyone can give.

Also, if anyone knows how to make it so when I upload a file, the file uploader window doesn't show up, that'd be appreciated. Currently on -silent, all I see is the file upload window, which is a tad annoying if it's possible to disable somehow. Because of these file dialogs, if I try to do anything on my computer while it's running, the macro seems to fail. Also, it seems that imacros works slightly differently on -silent mode, as some things seem to work off silent that wont work on -silent. For example, I made an imacro to upload 50 images to my queue, and it failed at ~3 on silent and at ~11 on non-silent. The failures seem to come, at least when I'm running it in the browser, due to "can't find html element...", which as far as I can tell, just means I need to put a longer wait there in case it takes some time to load? Or do load times just increase over the length of a macro's execution for some reason? Should I split it into a bunch of smaller macros? Or will it continue to fail doing 8 runs of 4 posts as much it does doing 50 posts in one script? I'm not really sure how to handle that. The code is the same for 50 posts, but for some reason it fails on a different # each time. There are plenty of other examples of -silent failing before non-silent too, often involving DS.



regarding 2 & 3, is iMacros just not robust enough to handle a single script doing the same thing 50 times over? I could split it to groups of 4, but as this is my first major iMacros, I want it to be my most complicated/robust so that I know that I can handle everything else I need to make for my project, which is automating social media.

Info about my system:
Version 10
Windows 10
iMacros Browser v10 (also having issues trying it in chrome)
Pfff, just quoting your edited-edited-edited-etc OP as you keep editing it, not to be followed..., sorry...! :roll:
Very funny and a good Lesson for me (again...!), I usually always quote Posts by Posts in all Threads where I react, many Users tend to delete their OP once they get their Answer which renders the whole Thread useless for other Users searching the Forum and I thought, OK not needed for this one, the "OP-User" is a Programmer, they will know how to use a Technical Forum correctly, but pfff, you got me a bit lost with all your Edits, ah-ah...! :shock:
Post Updates in new Posts instead of constantly editing your OP, it's not a piece of Code that you need to debug and improve until you get it to "work"...!, we cannot follow you..., very messy...!, I hope you don't program this way...!
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Lightja
Posts: 20
Joined: Tue Aug 30, 2016 3:40 am

Re: Randomly getting Error 1300, -silent mode, and avoiding

Post by Lightja » Thu Sep 01, 2016 9:52 pm

Sorry for all the edits, got a lot messier than I intended. I would have just added posts/threads, but I didn't want to get penalized for "bumping" my thread and I just didn't want to fill the board with my own questions. Also, I've just been running into various different issues as I try different things, but now it basically boils down to what's in the title (plus one), the same issues I've had from the start, but more generally speaking rather than specific points in the code. I'll follow your advice from now on, and I'll clean up the thread so it makes more sense. I'd hope it'll be helpful for anyone in the future who might have similar issues.

So my problems are:

1. I'm randomly getting error 1300.
2. I randomly get error 1300 more often when in -silent mode
3. I just want some advice on how to avoid DS when there are certain elements that aren't recordable. For example, pressing the unfollow button on tumblr doesn't record anything for some reason. I decoded what the original reply did with the SELECTOR feature, and realized that he worked down the hierarchy of the DIVs to get to the tag field. However, I don't really know how to apply this to TAG or anything similar.
4. Sometimes when running the script which uploads files, it gets stuck on the file upload dialog. Usually it opens and closes really quickly. Occasionally however, it opens, and nothing happens. Even when I close the dialog it doesn't continue and the macro just gets stopped there and doesn't continue.

So for error 1300, I've looked up plenty on the issue. I've tried setting the TIMOUT_STEP higher, as high as 30 seconds, and that seems to have no effect on how often the error comes up, which is kind of surprising. Setting REPLAYSPEED to MEDIUM or even SLOW has helped, but the issue still persists occasionally.

I've half-way solved the error 1300 issue by doing uploads in groups of 4 rather than trying to do a full 50. I still would like to figure out what's causing the random failures, or if it's just in the nature of iMacros/internet connectivity/etc for macros to fail occasionally. I know websites don't always load perfectly every time, and that might be to blame, I just want confirmation from someone who's experienced that, so I can design around that flaw, or to have someone tell me otherwise, so that I can find the issue and have 100% reliable macros.

I appreciate the help and advice. Also, I updated to version 11.1, so the EVENT command should now work, which should be helpful.
Latest System Information:
iMacros 11.1
Windows 10 Enterprise
Firefox v48.0.2 - iMacros for Firefox v8.9.7
Chrome v53.0.2785.89 - iMacros for Chrome v8.4.4
chivracq
Posts: 8790
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Randomly getting Error 1300, -silent mode, and avoiding

Post by chivracq » Fri Sep 02, 2016 3:58 pm

Lightja wrote:Sorry for all the edits, got a lot messier than I intended. I would have just added posts/threads, but I didn't want to get penalized for "bumping" my thread and I just didn't want to fill the board with my own questions. Also, I've just been running into various different issues as I try different things, but now it basically boils down to what's in the title (plus one), the same issues I've had from the start, but more generally speaking rather than specific points in the code. I'll follow your advice from now on, and I'll clean up the thread so it makes more sense. I'd hope it'll be helpful for anyone in the future who might have similar issues.

So my problems are:

1. I'm randomly getting error 1300.
2. I randomly get error 1300 more often when in -silent mode
3. I just want some advice on how to avoid DS when there are certain elements that aren't recordable. For example, pressing the unfollow button on tumblr doesn't record anything for some reason. I decoded what the original reply did with the SELECTOR feature, and realized that he worked down the hierarchy of the DIVs to get to the tag field. However, I don't really know how to apply this to TAG or anything similar.
4. Sometimes when running the script which uploads files, it gets stuck on the file upload dialog. Usually it opens and closes really quickly. Occasionally however, it opens, and nothing happens. Even when I close the dialog it doesn't continue and the macro just gets stopped there and doesn't continue.

So for error 1300, I've looked up plenty on the issue. I've tried setting the TIMOUT_STEP higher, as high as 30 seconds, and that seems to have no effect on how often the error comes up, which is kind of surprising. Setting REPLAYSPEED to MEDIUM or even SLOW has helped, but the issue still persists occasionally.

I've half-way solved the error 1300 issue by doing uploads in groups of 4 rather than trying to do a full 50. I still would like to figure out what's causing the random failures, or if it's just in the nature of iMacros/internet connectivity/etc for macros to fail occasionally. I know websites don't always load perfectly every time, and that might be to blame, I just want confirmation from someone who's experienced that, so I can design around that flaw, or to have someone tell me otherwise, so that I can find the issue and have 100% reliable macros.

I appreciate the help and advice. Also, I updated to version 11.1, so the EVENT command should now work, which should be helpful.
Yep, good-good...!

OK, yep, with iMB11 you now have both the DS and the EVENT Modes at your disposal, ah-ah...!

The 'SELECTOR' Syntax is even available as well for the 'TAG' Mode but I think it's only been implemented for iMacros for CR in v8.4.4, I'm not sure if it's implemented in iMB11 yet and I think not. I haven't checked yet in iMacros for FF v9.x as I haven't installed v9.0.3 yet, last time I checked was in v8.9.6 or v8.9.7 and it was not the case yet. But iMacros for FF v9.0.3 or for CR v8.4.4 wouldn't be usable Options for you as the File Upload Functionality is not available in those 2 Versions...

For thorough Error Checking and checking that a Page has fully/correctly loaded, you can maybe have a look at this Thread where I had mentioned a few "Techniques" + search my Posts on "Conditional REFRESH" for a few similar Threads, and for "spotting" the cause of the -1300 Pb, you could enable the Profiler and/or include your own Logging with a fw "strategic" Extracts + 'SAVEAS' to some Text File. And to prevent the Macro from aborting, you could simply use '!ERRORIGNORE', combined with some Logging/Reporting to rerun your Macro only for the Files that failed to download (correctly).
Last edited by chivracq on Sat Sep 03, 2016 9:35 am, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Lightja
Posts: 20
Joined: Tue Aug 30, 2016 3:40 am

Re: Randomly getting Error 1300, -silent mode, and avoiding

Post by Lightja » Fri Sep 02, 2016 9:01 pm

Wow, I can't believe I was even using iMacros 10... For some reason I thought that was the latest, or close to it. The iMacros 11 recording is infinitely better with 3 different forms of TAG (including CSS SELECTOR, so yeah it's implemented) recording as well as EVENT recording added. This makes a huge difference and almost completely solves my first problem of avoiding DS. These were basically the options I was looking for, but implementing them on IM10 was kinda difficult since I was new to the language, but having the recorder do it for me helps so much in understanding how it works, plus it seems like the recorder records almost everything that I was previously having issues with. IM 11 is a godsend.

Thanks for the link to the other post talking about the error 1300 issues, that looks very useful too. I have been using logs, but don't think I've tried the profiler. ERRORIGNORE works for some macros, and might be helpful for some aspects of it, but there are areas where if it fails, the whole macro is useless (e.g. on the file upload, or clicking the file upload button, which is where it fails most often). I'll let you know how it goes. Might even try some different commands recorded via IM11 to see if they fail less often.

Any idea why -silent mode seems to fail more often?
Latest System Information:
iMacros 11.1
Windows 10 Enterprise
Firefox v48.0.2 - iMacros for Firefox v8.9.7
Chrome v53.0.2785.89 - iMacros for Chrome v8.4.4
Post Reply