O
O
Olya Pilipenko2014-02-07 00:42:31
PHP
Olya Pilipenko, 2014-02-07 00:42:31

How to implement div parsing in PHP?

Hello! I need to parse prices from one site, which are in divs with identifiers. div's are absolutely different, but numbers.
How is it more convenient to implement this?
I just came up with the idea of ​​making an array of div identifiers and parsing them in a loop.
Is there any way to do it less costly?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
AlexP11223, 2014-02-07
@AlexP11223

google -> "php html parser" -> for example Simple HTML DOM Parser

S
sasha, 2014-02-07
@madmages

habrahabr.ru/post/110112 - the best thing for parsing html

P
PhantomBlade, 2014-02-07
@PhantomBlade

PHP has a class, a set of DOM classes that can be used to process xml (including html). To search, you need DOMXPath. www.php.net/manual/en/class.domxpath.php

E
egorist, 2017-05-07
@egorist

https://github.com/wasinger/htmlpagedom

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question