저는 Windows Phone 프로그래밍이 처음이므로 예를 들어 http://www.flipkart.com/search/a/computers?query=ipad+3Windows 전화에서 검색 쿼리를 작성하고 결과를 목록 상자에 채우십시오.
나는 downloadStringAsync 기능을 사용하여 webclient를 사용하여이 작업을 수행하고 있습니다. 이제는 모든 검색 결과를 다시 검색하기 위해 XML 문서 여야하지만 발견 할 수없는 하위 항목, 하위 항목, 속성 등을 알 수있는 방법을 발견했습니다.
내가 잘못 사용하려는 방법입니까, 아니면 Windows 전화에서 이러한 종류의 검색어를 만들 수있는 다른 방법이 있습니까?
예가 가장 잘 이해 될 것이다.
데이터를 목록 상자에 다시 채워야합니다.
안녕하세요, htmlAgilityPack이 (가) 지금까지 작동하고있는 것 같습니다.하지만 검색 중에 null 참조가 나타납니다. 이것으로 도와주세요.
private void getPage()
{
var wc = new WebClient();
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
wc.DownloadStringAsync(new Uri("http://www.flipkart.com/search-tablets?query=ipad+3"));
}
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
HtmlAgilityPack.HtmlDocument html = new HtmlAgilityPack.HtmlDocument();
html.OptionFixNestedTags = true;
html.LoadHtml(e.Result);
var doc = html.DocumentNode.Descendants("div").FirstOrDefault(x => x.Id == "line price-cont");
String abc = doc.InnerText;
}
The html version do contain this kind of tag here is the copied part i want to fetch from the page
<div>
<div class="line price-cont ">
<div class='fk-price line'><span class="price final-price">Rs. 32900</span></div>
</div>
span 태그를 검색해 보았지만 여전히 null을 반환합니다. 모든 종류의 도움을 주시면 감사하겠습니다. 감사합니다.
내 최근 검색에서 나는 flipkart가 xml을 지원하지 않는다는 것을 알았습니다. HTML만을 반환한다고 생각합니다. 그래서 내가 파싱해야한다고 생각합니다. 그리고 ebay와 동일한 쿼리를 만들면 html only 또는 xml을 반환 할 것이고 어떻게 될까요? 나는 어떤 웹 사이트가 어떤 종류의 데이터를 반환하는지 안다. – virender