L
L
Lici2017-08-19 11:00:01
CMS
Lici, 2017-08-19 11:00:01

How to interact with the site through the parser?

I want to parse the data, for this you need to:
1) Get the page
2) Select the necessary items from the select on it
3) Send data to a specific field
4) Press the submit button
5) Pump out the result
During this whole thing, the URL does not change, so I do not I can send data through the browser line. I quickly figured out how to get the code, but what words to google in general to do this filling out forms and sending? How does is called?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
E
entermix, 2017-08-19
@entermix

First you need to understand how HTML forms work:
php.net/manual/ru/language.variables.external.php

E
Exploding, 2017-08-19
@Exploding

And you can find out a little more about what kind of data you want to "pump out" with the parser? Perhaps they are already in the public domain, but you don't know about them...
Very similar to a list of countries/regions/cities...

A
Alexander X, 2017-08-19
@san-x

if only for one specific form - then:
select the data in the select with your hands, open the Console / Network in the browser, click Send, study the request that was sent to the server and the server response.
then write a script that sends curl a series of the same POST(?) requests with different data (alternately throwing up data from the options) and parses the responses.
well, i.e. the bottom line is that it is not necessary to simulate the selection from the select and clicks on the buttons. it is enough to simulate the http requests that the front communicates with the back.

A
Alexander Petrov, 2017-08-19
@Mirkom63

You need ZennoPoster software

A
Alexey Shashenkov, 2017-08-19
@teknik2008

If you are familiar with nodejs. There is a good solution in the form of nightmarejs . it is essentially a headless browser. You can pull data, or interact with the site.

I
Igor Rusinov, 2017-08-19
@RusinovIG

If you need to exactly emulate user behavior and specifically with php, I advise you to take a closer look at Codeсeption with its PhpBrowser ( https://www.toptal.com/php/php-testing-with-codeception - there is an example with filling and submitting a form at the link).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question