Tell me, is it possible to work with xhtml / html via XmlDataProvider or does it work exclusively with .xml?

For example, I want to tear out a set of values ​​from the site and bring them to the list. I do this, but there is no result:

<Window.Resources> <XmlDataProvider Source="https://vk.com/" x:Key="vk"/> </Window.Resources> <Grid DataContext="{Binding Source={StaticResource vk}}"> <ListBox ItemsSource="{Binding XPath=//div/text()}"/> </Grid> 
  • one
    To obtain information from a site that has an official API (and vk has an API), you need to use the official API. Otherwise, expect a ban on the site that you parse. - VladD

1 answer 1

The XmlDataProvider really only works with XML. You need a parser library, I recommend AngleSharp