So I have a gdb, and the feature class I'm working on has a field that is formatted in html for ArcGISOnline. This is great if I'm only viewing the data online. What I'm trying to do is copy that attribute data to a new field and then convert the data from html. There is a great tool that does this well, html2text.
My question is: How do I go about getting the tool to play nice with arcpy?
Here's where I am right now and it's not converting the value for me
import html2text, arcpy from arcpy import env arcpy.env.workspace = "C:/Workspace/Data_National/RGOV/temp/20170330_RGOV.gdb/" Rgdb = "C:/Workspace/Data_National/RGOV/temp/20170330_RGOV.gdb" FFA = Rgdb + "/RSites/Facapp" arcpy.AddField_management(FFA, "FFA", "TEXT", "", "", "8000") with arcpy.da.SearchCursor(FFA, "FACILITYDESCRIPTION") as cursor: for htmlformat, in cursor: Expression = html2text.html2text(htmlformat) arcpy.CalculateField_management(FFA, "FFA", html2text.html2text('!FACILITYDESCRIPTION!'), "PYTHON_9.3", Expression)
Any pointers on where I'm going wrong? I also tried throwing a
arcpy.CalculateField_management(FFA, "FFA", html2text.html2text('!FACILITYDESCRIPTION!'), "PYTHON_9.3")
but it didn't work...
When I used the CalculateField tool, the script runs through with no errors, but keeps the html formatting.
When I try it with the SearchCursor section of the script I get an error of "data = data.replace("/' + 'script)", "(/ignore)")