Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.0 C# jQuery
I am using visual studio 2010 i am using httpwebrequest and httpwebresponse to get page source and for crawling the webpage i am using htmlagilitypack
I want to using :eq selector to reterive data from page source i have found out this can be done using fizzlerEx
 
http://fizzlerex.codeplex.com/[^]
Example give in the website
 
using HtmlAgilityPack;
using Fizzler.Systems.HtmlAgilityPack;
 
var web = new HtmlWeb();
var document = web.Load("http://example.com/page.html")
var page = document.DocumentNode;
 
foreach(var item in page.QuerySelectorAll("div.item"))
{
    var title = item.QuerySelector("h3:not(.share)").InnerText;
    var date = DateTime.Parse(item.QuerySelector("span:eq(2)").InnerText);
    var description = item.QuerySelector("span:has(b)").InnerHtml;
}
 
and i am trying the same
var page123 = doc.DocumentNode;
                foreach(var item in page123.QuerySelectorAll("body"))
                {                    
                    var date = item.QuerySelector("b:eq(10)");
                }
 
but i am getting error
"Unknown functional pseudo 'eq'. Only nth-child is supported."
please can any body help me with problem.
Posted 6-Dec-12 2:13am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 235
1 Sergey Alexandrovich Kryukov 120
2 Richard MacCutchan 100
3 kbrandwijk 85
4 Vinay Mistry 70
0 Sergey Alexandrovich Kryukov 9,056
1 OriginalGriff 8,041
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100