Try bs4
from bs4 import BeautifulSoup
import lxml
mystr = '<object id="svg_chart" class="map-svg uk-animation-fade" type="image/svg+xml" data="https://services.dat.com/svg/graph.svg?showAllLabels=true&vgrid=true&lineWidth=4&op_min=75&minYValue=0&maxYValue=10&yStep=2&title=Van%20Load-to-Truck%20Ratio&labels=Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec&colors=_F89929,_57CAF1,_B686BB&ds_3=2020|2.23,1.84,2.89,0.98,1.91,3.52,4.40,5.31,5.45,4.33,4.49,4.84&ds_2=2021|4.27,7.54,5.78,4.79,6.12,5.56,5.81,6.46,6.32,5.59,5.19,6.54&ds_1=2022|9.34,7.33,4.57,3.42,4.39,3.88,3.84,3.54,null,null,null,null&copyright=%40%202022%20DAT%20Freight%20%26%20Analytics" width="" height=""></object>'
soup = BeautifulSoup(mystr, 'lxml')
obj = soup.find('object')
print(obj['id'])
print(obj['class'])
print(obj['type'])
print(obj['data'])
... result
'''
svg_chart
['map-svg', 'uk-animation-fade']
image/svg+xml
https://services.dat.com/svg/graph.svg?showAllLabels=true&vgrid=true&lineWidth=4&op_min=75&minYValue=0&maxYValue=10&yStep=2&title=Van%20Load-to-Truck%20Ratio&labels=Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec&colors=_F89929,_57CAF1,_B686BB&ds_3=2020|2.23,1.84,2.89,0.98,1.91,3.52,4.40,5.31,5.45,4.33,4.49,4.84&ds_2=2021|4.27,7.54,5.78,4.79,6.12,5.56,5.81,6.46,6.32,5.59,5.19,6.54&ds_1=2022|9.34,7.33,4.57,3.42,4.39,3.88,3.84,3.54,null,null,null,null©right=%40%202022%20DAT%20Freight%20%26%20Analytics
'''
This is because obj.attrs is a dictionary and you can do whatever you want with it:
print(type(obj.attrs))
# result
# <class 'dict'>
# You can get all of the attrs like this too
for k, v in obj.attrs.items():
print(k + ' == ' + str(v))
# result
'''
id == svg_chart
class == ['map-svg', 'uk-animation-fade']
type == image/svg+xml
data == https://services.dat.com/svg/graph.svg?showAllLabels=true&vgrid=true&lineWidth=4&op_min=75&minYValue=0&maxYValue=10&yStep=2&title=Van%20Load-to-Truck%20Ratio&labels=Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec&colors=_F89929,_57CAF1,_B686BB&ds_3=2020|2.23,1.84,2.89,0.98,1.91,3.52,4.40,5.31,5.45,4.33,4.49,4.84&ds_2=2021|4.27,7.54,5.78,4.79,6.12,5.56,5.81,6.46,6.32,5.59,5.19,6.54&ds_1=2022|9.34,7.33,4.57,3.42,4.39,3.88,3.84,3.54,null,null,null,null©right=%40%202022%20DAT%20Freight%20%26%20Analytics
width ==
height ==
'''