K
K
kapai692014-01-22 10:10:54
PHP
kapai69, 2014-01-22 10:10:54

How to implement price parsing from sites for certain products?

How to implement price parsing from sites for certain products, the first thing that comes to mind is to write regular expressions for each store, but it’s somehow not beautiful, use libraries for parsing, or is there a more elegant way?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
B
bahek2462774, 2014-01-22
@bahek2462774

phpQuery - selection can be done as in jQuery . For simple tasks - it is quite suitable.

D
Dmitry, 2014-01-22
@DmitryDorofeev

Option for PHP. I was engaged in price parsing, first I parsed regulars. Then I found a more elegant way. In my opinion the best way is XPath. We load the page with curl or file_get_contents, add <?xml encoding="UTF-8"> before it, load it all into a DOM object, then calmly parse using queries =)

Z
zvorygin, 2014-01-22
@zvorygin

I once used jsoup.org - a parser in Java, you can rip out data by css selectors - it turned out to be very convenient.

I
Ivan, 2014-01-22
@Praeses

You can think about a similar option, as done in Google Webmaster - a marker.
That is, the page is loaded into a special web interface, the administrator indicates which part of the data is on the page - which means. Then the system automatically pulls up several other pages-similar-templates to clarify the information. This will allow you to quickly install parsing for any online store. True, this is not easy, perhaps you need to use neural networks. Or look for open analogues.

Z
ZloiZmei, 2014-01-22
@ZloiZmei

You can parse Yandex.Market if stores are represented there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question