Questions tagged [csquery]

CsQuery is a complete CSS selector engine, HTML parser, and jQuery port for C# and .NET 4+

CsQuery is a jQuery port for .NET 4. It implements all CSS2 & CSS3 selectors, all the DOM manipulation methods of jQuery, and some of the utility methods. The majority of the jQuery test suite (as of 1.6.2) has been ported to C#. Here is its official github.

69 questions
0
votes
2 answers

CsQuery: how to iterate over all elements?

I need to implement a function that returns the first element the has Id attribute that contains a certain string. in HAP I used to implement it as follows: protected HtmlNode GetElementByIdPattern(string pattern) { return doc …
Nizar Blond
  • 1,826
  • 5
  • 20
  • 42
0
votes
1 answer

C# CsQuery as Html Documents Builder

So far I used HtmlAgilityPack for building Html documents. The problem is that it is not stable, I get Stackoverflow Exceptions and it doesn't support jQuery syntax. What I am trying to use to build Html documents is CsQuery. My question is: Is it…
Nizar Blond
  • 1,826
  • 5
  • 20
  • 42
0
votes
1 answer

CsQuery append to

I need to append Html element after an existing element in CsQuery, for example: I've this code CQ frgt = CQ.CreateFragment("

some text

"); CQ html = CQ.CreateFromFile("index.html"); // I also tried .Append instead of…
Nizar Blond
  • 1,826
  • 5
  • 20
  • 42
0
votes
1 answer

Getting Value from TaskCompleteSource

I'm having some trouble getting the data from TaskCompleteSource. I am making an Async request to the server, and it should be returning the HTML from the login page. This works synchronous, but not Asyn. When calling client.ExecuteAsync is it…
James Jeffery
  • 12,093
  • 19
  • 74
  • 108
0
votes
2 answers

iframe runat="server" inner HTML being HTML encoded automatically

My master page has the and section as follows:
Chris Cannon
  • 1,157
  • 5
  • 15
  • 36
0
votes
2 answers

CsQuery - Efficiently selecting, iterating and changing state e.g. For loop vs Each method

Using CsQuery I need to modify a set of anchor elements e.g. '... Dim cqContext = WebForms.CreateFromRender(Page, AddressOf MyBase.Render, writer) Dim cq = cqContext.Dom Dim foo = cq("a") '... For example, on all anchor elements I need to…
Chris Cannon
  • 1,157
  • 5
  • 15
  • 36
0
votes
1 answer

Using CsQuery in MasterPage code-behind to modify HTML output?

What's the "skeleton" code for using CsQuery in the code-behind of a MasterPage in order to modify the HTML output? I need to be able to modify everything in the of the HTML? I'm hoping to use CsQuery to "touch-up" the HTML output of a…
Chris Cannon
  • 1,157
  • 5
  • 15
  • 36
0
votes
1 answer

CsQuery or Jint? Javascript data manipulation in C#

I'm writing a web crawler for statistic purposes. The website dynamically updates through javascript. I managed to parse the HTML file and copy all script values into an array. How do i re-execute these scripts locally or on-the-fly in order to get…
0
votes
2 answers

ASP.NET - Parse / Query HTML Before Transmission and Insert CSS Class References

As a web developer I feel too much of my time is spent on CSS. I am trying to come up with a solution where I can write re-usable CSS i.e. classes and reference these classes in the HTML without additional code in ASPX or ASCX files etc. or…
Chris Cannon
  • 1,157
  • 5
  • 15
  • 36
1 2 3 4
5