Answer the question
In order to leave comments, you need to log in
How to identify api from third party site?
There is a site " https://my2.soliq.uz/main/info/search ".
From there you need to pull out data about enterprises by their TIN.
Selenium and Request libraries are ready, but the Request library needs to know the API of this site.
Then it will be possible to write "requests.get (api). json ()"
Please teach how to find API in such open sites
Answer the question
In order to leave comments, you need to log in
Not all sites have an open API. And if it is, then in most cases you can find documentation for it on the site.
Your site, it seems to me, does not have an API to be used by ordinary users. Or maybe there is some corporate one, but it is closed to us.
Rather, you need to know not the API, but the link on which you need to make a request in order to get information. Opens the code inspector (view code) and go to the Network tab. We put a record of events (red button in the upper left corner). Next, on the site, stupidly click the find button and look at the request. (In the inn, you can enter some game and not bathe).
And we see:
So. After clicking on the button, we can see the skipped request.
Now we know the URL to send the request to:https://my2.soliq.uz/main/info/search/data
Method: POST
And an approximate data structure that we need to send (Form Data).
You can see in the searchtext field our previously entered text in the field.
All. You make a post request to the given url and pass the data. You get an answer.
Just go to dev tools > Network in your browser and keep track of what requests are being made by website activity and copy that data into your code. In the Headers tab - data for creating a request, in the Response tab - the response body
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question