Skip to main content
Solved

I'm getting a bot error message when trying to run a python script

  • June 27, 2024
  • 4 replies
  • 375 views

Forum|alt.badge.img+1

I’m creating a bot that gets information from tables in a website and I’m trying to put all of that information in an excell sheet.
I created a script in python that retrieves me the column of the excell based on the number I passed to the function, and that number is supossed to be the column.
 


 So basically, I’m iterating through each table and through each row of the table and I’m trying to put the information of the row in a column in the spreasheet. I’m new to automation anywhere so I don’t know if there is a better way to do that. 

I’m trying to print the result from the script but I keep getting this:
 

I don’t think the script is wrong because when I ran it in VSCODE it gave the right column. How can I solve this problem ?

Best answer by Aaron.Gleason

Step 1. Don't use Python for this.  😄

Instead, use Recorder:Capture to capture the HTML table. Using the "Get table" method, you can extract the HTML contents into an in-memory table (kinda like Pandas).

From there, open the target spreadsheet and use Excel advanced:Write from data table to write to the Excel file. Remember to save and close. 

Please refer to the Pathfinder Academy for a walkthrough. 

4 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • Answer
  • June 28, 2024

Step 1. Don't use Python for this.  😄

Instead, use Recorder:Capture to capture the HTML table. Using the "Get table" method, you can extract the HTML contents into an in-memory table (kinda like Pandas).

From there, open the target spreadsheet and use Excel advanced:Write from data table to write to the Excel file. Remember to save and close. 

Please refer to the Pathfinder Academy for a walkthrough. 


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • June 28, 2024

@Aaron.Gleason Thank you for your support!
I did a workaround that gave me the result I was needing 😅
I’ll make sure to use the Excel advanced:Write from data table from now on.


Forum|alt.badge.img+2
  • June 28, 2024

@Jonaires777 

I just wanted to add that the full error text for Python scripts will be located in the bot log files.  When you see “Bot Error” returned by the script navigate to the logs located here to find the full error details:

C:\ProgramData\AutomationAnywhere\BotRunner\Logs\<current month>\Bot_Launcher-<today's date>.log

  


Forum|alt.badge.img+1
  • Cadet | Tier 2
  • October 12, 2025

Check the indentation  even a single space can lead to bot error , -it should work :)