aisingapore / TagUI

Free RPA tool by AI Singapore
Apache License 2.0
5.67k stars 584 forks source link

在数据导入excel之后再使用 count()报错 - pending log and replication details #1383

Closed yyb6666 closed 3 months ago

yyb6666 commented 3 months ago

在数据导入excel之后再使用 count()报错 ERROR - 1 is not a constructor (evaluating 'count('Card--doubleCardWrapper--L2XFE73')') A duplicate file name exists, or the file cannot be found. 微信截图_20240801153254 https://taobao.com type //[@id="q"] as [clear]乐事原切薯片分享装[enter] wait 2 click (0,200) click 销量 wait 2 read //[@id="pageContent"]/div[1]/div[3]/div[4]/div/div/div/button[last()] to page echo page aa = 0 items=[['商品标题','价格']] for b from 1 to page wait 2 for c from 1 to 3 keyboard [pagedown] wait 1 total_items=count('Card--doubleCardWrapper--L2XFE73') echo total_items for e from 1 to total_items titlelen = present("//[@id='pageContent']/div[1]/div[3]/div[3]/div/div["+e+"]/a/div/div[1]/div[2]/div/span") echo titlelen if titlelen read //[@id="pageContent"]/div[1]/div[3]/div[3]/div/div[e]/a/div/div[1]/div[2]/div/span to title read //*[@id="pageContent"]/div[1]/div[3]/div[3]/div/div[e]/a/div/div[1]/div[4]/div[1] to price js items[e+aa] = items[e+aa] || [] js items[e+aa][0] = title echo items js items[e+aa][1] = price echo items wait 2 wait 1 click 下一页 aa+=total_items [E:\AA.xlsx]sheet1!A2 = items wait 5 循环里第一次是正常的导入了第一页商品的信息 然后翻到下一页 total_items=count('Card--doubleCardWrapper--L2XFE73')走这个获取总数时就会报错 试了很多情况就是在执行了[E:\AA.xlsx]sheet1!A2 = items导入excel指令后再 执行count就会报这个错 如果不执行导入excel指令 到下一页就可以正常计算总数

yyb6666 commented 3 months ago

@ruthtxh @kensoh @siowyisheng

yyb6666 commented 3 months ago

image

kensoh commented 3 months ago

Hi @yyb6666 I've not seen this error before. It is most likely due to TagUI not interpreting the fairly complicated workflow structure above. Can you try the following?

  1. simplifying to something basic to see what is the most basic TagUI workflow that you can create this error
  2. if you are able to do step 1, can you attach the generated .js file here so that I can see the source code?
  3. if you are not able to do step 1, can you attach the generated .js file of the above workflow you shared
kensoh commented 3 months ago

(closing issue for now, but will look out for your reply if any)