N
N
Nikita Kornilov2019-12-16 17:05:38
JavaScript
Nikita Kornilov, 2019-12-16 17:05:38

How to parse data from a website using JS?

Good day!
There is a website - parts.major-auto.ru/SearchNew. I want to write a script that will enter a specific part number in the input field, press the search button and take the cost of the found part from the final table. Please tell me how can this be done?
5df78f80a0665232565549.png
I read about parsers, but the solutions I found turned out to be too tricky. Is there some simple and universal solution that will automatically perform this task?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
tef, 2019-12-16
@Nikkorfed

If this is a question about javascript, then in general the solution can be written by hand. All this is done with a userscript. Open the file, take the name of the part from it, look at the class/id of the search string input, look at the name of the class or ID in the tag in which the search answer is given. In general, everything. Insert a query into the search line by class, then a timeout to wait for an answer, take away the innertext from the search results. This is the algorithm (path).
If the question is about automated and universal ready-made solutions, then I have not seen such ones, because each site will have its own class names and some accompanying tricks.
If you really need a js parser for a specific site, then I think that freelancing will write you thousands for 3-4.

U
Uno, 2019-12-16
@Noizefan

The easy solution is freelancing

K
Kiljko, 2019-12-16
@kiidii_aniname

The papier will help you. It is supported by Google and in principle is very good for parsing pages on the Internet. What's more, you can easily customize data entry, mouse clicks, and more. Here is the link: https://pptr.dev

F
fan92rus, 2019-12-17
@fan92rus

you can use userscripts or PhantomJS to emulate a browser from under node js. if everything is simpler and the content is not generated on the client side, then you can send requests via fetch or axios and parse via node-html-parser or the like.
take the part number from the field, substitute it in the link, send a request and parse. it will be cheaper in terms of resources

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question