Search code examples
automationanywhere

Get Title of html file which is downloaded on my machine in automation anywhere


I'm a newbie and this is my first try at Automation anywhere bot building.

I need to get the title of a html file downloaded on my machine.

So, basically I need to traverse the html and get title.

I found questions like Use Xpath to get all the rows of a table after a specific row in Automation Anywhere which speak of xpath and html traversal.

But, I cant seem to find any article which says how to get source code of a html file in my computer. Nor, where to put these xpath codes. Maybe everyone knows and as I'm a new, I can't figure it out.

This is what I tried...

I renamed the file to xml and tried to start a xml session and get the node //html/title

But it throws the below error at start session.

All help is sincerely appreciated.

Thanks

error


Solution

  • Another workaround would be: rename the file to text and read the title from it.

    1. Rename HTML file to TXT file.
    2. Using Read From CSV/Text command read the text file.
    3. Within the loop, use if condition on variable, FileDataColumn(1) if includes <title>
    4. Using string operation before and after command, Before: <title> After: </title> and assign the output to a variable, and that would be the HTML title.

    enter image description here