Answer the question
In order to leave comments, you need to log in
How to set up site parsing from JavaScript to C#?
Good afternoon kitties. Please help me with this question. There is a government website that posts documents on its website. The site has a JavaScript module that displays links to documents in the table.
To get a link, you need to open the drop-down list and select the required section with the document. Initially, the source code of the page does not contain all the links to the files. They are generated by the script. Moreover, it generates these links even without access to the Internet. You just need to download this module. It is necessary to somehow open all the drop-down lists so that the script gives links to documents in the source code of the page and I can pull them out with my parser. Tell me, is it possible to open all the drop-down lists with some script? I'm not very good at JavaScript. I don't know if links can be posted. If anything, the link to this section of the site is in the screenshot.
Answer the question
In order to leave comments, you need to log in
In your case,
everything is very simple.
The client sends a request to the server (you can try opening the link in a browser)
and receives a response with the entire list (json). And on it already generates the table.
You can also make a request, get JSON and parse it.
There is Selenium, there is a WebBrowser, you find the necessary elements and click () on them.
Requires Selenium. From C#, it communicates with a head-less browser (this can be PhantomJS, run with the webdriver option ) follows the Webdrive protocol. In a nutshell: Automated Web Application Testing (MS... .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question