yoavaviram / python-amazon-simple-product-api

A simple Python wrapper for the Amazon.com Product Advertising API ⛺
Apache License 2.0
817 stars 212 forks source link

Accessing returned values for Item and Package Dimensions #122

Open JasonCrowe opened 7 years ago

JasonCrowe commented 7 years ago

The following information is returned by Bottlenose. How can I access it? `

1350 1130 990 750

`

`

1098
 <Length Units="hundredths-inches">
  1701
 </Length>
 <Weight Units="hundredths-pounds">
  1280
 </Weight>
 <Width Units="hundredths-inches">
  1449
 </Width>
</PackageDimensions>`
ilyaresh commented 6 years ago

Hi @JasonCrowe You can use _safe_get_element() function

 print("Height:" + str(product._safe_get_element("ItemAttributes.ItemDimensions.Height")))

Will print

Height:400