0

Im Trying to get the price of an Item on a Webside but i always get a NullRefernce Exception. The Webside is this one; https://de.aliexpress.com/item/32621874449.html

htmlDocument.DocumentNode.SelectSingleNode("//*[@id='root']/div/div[1]/div/div[2]/div[4]/div[1]/span").InnerText

What am I doing wrong?

Seha
  • 1
  • You call SelectSingleNode and then blindly proceed to use the InnerText property of the DocumentNode class. You don't check if the call has found the node or not. But what if the call doesn't find the node that matches your path? – Steve May 23 '20 at 20:05
  • Did you try convert to string? ``.InnerText.ToString();`` – Göksel ÖZER May 23 '20 at 21:21

0 Answers0