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
1
vote
2 answers

Retrieving webpage data after some delay (web scraping)

The Aim is to retrieve data from a website after it has finished its Ajax calls. Currently the data is being retrieved when the page first loads. But the required data is found inside a div which is loaded after an ajax call. To summarize , the…
Abdul Ali
  • 1,905
  • 8
  • 28
  • 50
0
votes
0 answers

Remove HTML Tags After a Specific Tag

I am trying to remove some HTML tags from an HTML string. My HTML looks like following:

Dont want to remove this tag

Remove all Tag after this tag except style

some more text…

Ali
  • 1,015
  • 14
  • 40
0
votes
0 answers

CsQuery filter html

I have a block of html code which represents the second verse of the book of James from the bible: 2
0
votes
0 answers

c# - Error when attempting to use CsQuery to iterate through ordered list from webpage

So I initially posted a couple days ago requesting assistance for the development of a project which loaded up a webpage and filtered out the desired contents from an ordered list tag. A user was very helpful in providing me the method on how to…
Jayps
  • 35
  • 8
0
votes
0 answers

Get the width of an HTML element via CsQuery

Update on 06/06/2017: Thanks for jdweng's help, it seems that CsQuery doesn't have the method to get the offSetHeight & offSetWidth of an element. I's using CsQuery in C# to analyse static HTML files, and want to get the Height and Width of an …
Rick
  • 322
  • 2
  • 8
0
votes
0 answers

CsQuery/JQuery can't get element from google search

I'm trying to get the results of a google "define word" search. According to Chrome's Inspect Elements, the text I want is under the class "div class="lr_dct_ent vmod" data-hveid="28"" I'm using this code to try and do it: var thecq =…
0
votes
0 answers

C# log into site by GET query plus CsQuery

community! I need your help. I faced with the problem where I have to log into the site to parse some information. I can't find the information how I can log into the site by CsQuery, but I found information that I can to log into the site by…
user5783755
0
votes
1 answer

C# - How to get anchor of link using CSQuery

I get all links on the current page, and then I looking for link that I need and then I want to get anchor (text between open and end tag of "a") of this link. I tried to use "obj.GetAttribute("innerText")", but it returns an empty…
Alex
  • 121
  • 5
0
votes
2 answers

CSQuery Parsing non-english text

I am using CSQuery to parse a website in arabic. When I use text() function it returns the text as is, however when I use html() function it uses html encoding. for example this is my html tag:
تعلن عن إرسالها مركبة فضائية للمريخ قريباً…
Lamar
  • 1,761
  • 4
  • 24
  • 50
0
votes
2 answers

CsQuery - find element with concrete name

I have to parse html like this:
0
votes
1 answer

csQuery select element from manipulated dom?

I am rendering the dom from a file which works just fine. Then I manipulate the dom with jQuery with a on click event. My question is: How can I get the manipulated element from code behind now? $(document).ready(function() { var x =…
MartinDK81
  • 343
  • 2
  • 8
  • 16
0
votes
2 answers

how to remove all script tags in a html content with CsQuery

i am using CsQuery library for crawling. Code is like this. var dom = CQ.CreateDocument(htmlContent); resultText= dom[cssSelector].Text(); I don't want script tags in resultText for example this part I tried this…
Must.Tek
  • 1,220
  • 10
  • 17
0
votes
0 answers

reading an xml file in C# using CsQuery

using CsQuery; namespace CSQuery { class Program { static void Main(string[] args) { var dom = CQ.Create(/*I am not sure what goes here*/); //Not sure if this is the correct setup…
NickJ
  • 25
  • 8
0
votes
1 answer

$(this) equivalent in CsQuery

is there equivalent for $(this) in csquery.. in below example letterbody string has html content. i want to prepand text before each tag. var dom = CQ.Create(letterBody); CQ divs = dom.Select("p"); divs.Each( (index,…
bayyinah
  • 139
  • 1
  • 3
  • 12