A
A
Alexey Smirnov2017-03-17 16:11:30
HTML
Alexey Smirnov, 2017-03-17 16:11:30

How to simulate a mouse click on a button on a website, and then get a new page and write its html to a variable?

Hello.
There is some site. Having entered which, I first need to click on one of the buttons located on the web page. After that, the site server will give me a new web page. Next, I need to get the html code of the page received from the server (as a string).
That is, the sequence of actions is (I repeat):
1) Load some site
2) Click on the button on the site
3) After loading a new page received from the server, copy the entire html into a string variable
How can this be implemented in C # .NET using third party libraries (or no third party libraries)?
PS I met the WatiN framework, which allows you to simulate a mouse click on a button on a site. And then I don't know how to proceed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Eremin, 2017-03-17
@ERAFY

Here: https://bitbucket.org/rflechner/scrapysharp/wiki/Home
And here is an example of using https://habrahabr.ru/post/323202/

A
Astrohas, 2017-03-17
@Astrohas

Do you know, maybe I could be wrong, but I stupidly loaded the site into the WebBrowser, adding a couple of lines of javascript through .DocumentText and after the update I would take this .DocumentText

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question