F
F
freshlemon2019-06-20 09:40:16
JavaScript
freshlemon, 2019-06-20 09:40:16

How to parse javascript in C#?

Hello, I'm trying to parse C# javascript from a website. The data is loaded onto it in real time, the parser must work almost constantly, it turns out to pull out everything except the javascript itself. In which direction should you move? As I understand it, in the direction of POST GET requests
This code produces absolutely nothing. Can't get to js

var items = document.QuerySelectorAll("span").Where(item => item.ClassName != null && item.ClassName.Contains("ticket-col"));

This code gives me this
var items = document.QuerySelectorAll("span");
5d0b29be3e4d2557347338.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#, 2019-06-20
@freshlemon

one -

I understand in the direction of POST GET requests
it's called in the API side. if the site provides it. and this is the right direction. If there is no API, then...
2 - js does not need to be parsed, it must be executed. sites on modern frameworks, as a rule, form a lot of things not on the server side, but already in the browser, just js code. and basically it's just filling the markup with data (by the way, it's not necessary GET / POST, it can be sockets as well). in this case, it is necessary not to parse, but to make a bot. for C#, you can try the basics on the built-in WebBrowser / WebView (Forms / WPF), but a more advanced option is CEF #. there is an analogue of CEF# "without a head" (display), but this is the next level of the game. I think it makes no sense to go there without experience. there is also a very popular variant of Selenium. there is a lib for sharp, the tool was originally for testing and not for creating bots. but it's easier for someone to start with it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question