Skip to main content
Solved

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

  • 27 June 2024
  • 3 replies
  • 111 views

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 ?

3 replies

Userlevel 4
Badge +7

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. 

Badge +1

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

Badge

@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

  

Reply