- Регистрация
- 04.02.2013
- Сообщения
- 945
- Благодарностей
- 257
- Баллы
- 63
Привет камрады! В общем не даёт мне долбанный маркет нормально разогнаться)) без понятия как реализовать регулярку с поддержкой html синтаксиса. Ооо.., скажете вы. ну, я туже мягко говоря в ах*е))
почему спросите? см. скриншот
дивов всегда разное количество, зависит от количества опций. можно конечно спарсить, только вот за один заход у меня пока голова не варит как.
почему спросите? см. скриншот
дивов всегда разное количество, зависит от количества опций. можно конечно спарсить, только вот за один заход у меня пока голова не варит как.
HTML:
<div class="n-product-summary__filters"><div class="n-product-top-filters i-bem n-product-top-filters_js_inited" data-bem="{"n-product-top-filters":{"gateUrl":"/api/product/12299034","additionalQueryParams":{"pageId":"market:product","geoWidgetName":"ProductTopOffersOnMap"}}}"><div class="n-filter-panel-inline-3000 i-bem n-filter-panel-inline-3000_js_inited" data-bem="{"n-filter-panel-inline-3000":{"filters":[{"hasDescription":"false","id":"2141414264","name":"Процессор (подробно)","type":"enum","values":[{"found":6,"id":"1338895370","value":"Intel Core i5"},{"found":2,"id":"1338895372","value":"Intel Core i7"}],"internalType":"glf"},{"hasDescription":"true","id":"2136921131","name":"Объем оперативной памяти","type":"enum","unit":"Гб","values":[{"found":3,"id":"8","value":"8"},{"found":5,"id":"16","value":"16"}],"internalType":"glf"},{"hasDescription":"true","id":"2142398542","name":"Частота процессора","type":"enum","unit":"МГц","values":[{"found":1,"id":"2600","value":"2600"},{"found":2,"id":"2700","value":"2700"},{"found":3,"id":"2900","value":"2900"},{"found":2,"id":"3100","value":"3100"}],"internalType":"glf"},{"hasDescription":"true","id":"2142398532","name":"Разрешение экрана","type":"enum","values":[{"found":1,"id":"126665899","value":"2560x1440"},{"found":7,"id":"126664101","value":"2560x1600"}],"internalType":"glf"},{"hasDescription":"true","id":"2142398522","name":"Объем жесткого диска","type":"enum","unit":"Гб","values":[{"found":1,"id":"128","value":"128"},{"found":3,"id":"256","value":"256"},{"found":3,"id":"512","value":"512"},{"found":1,"id":"1000","value":"1000"}],"internalType":"glf"},{"hasDescription":"true","id":"2142398543","name":"Процессор","type":"enum","values":[{"found":6,"id":"1670617603","value":"Core i5"},{"found":2,"id":"1670617601","value":"Core i7"}],"internalType":"glf"},{"id":"13887626","type":"enum","name":"Цвет","subType":"color","kind":2,"unit":"","position":6,"noffers":30,"values":[{"initialFound":29,"group":"серебристый","found":29,"value":"серебристый","code":"#F1F1F1","id":"13898623"},{"initialFound":1,"group":"серый","found":1,"value":"серый","code":"#666666","id":"13898641"}],"internalType":"glf"}]}}"><div class="n-filter-panel-inline-3000__title"><span class="n-filter-panel-inline-3000__name">Процессор (подробно)</span><span class="n-filter-panel-inline-3000__name">Объем оперативной памяти</span><span class="n-filter-panel-inline-3000__name">Частота процессора</span> и еще 4</div><button class="n-filter-panel-inline-3000__control i-bem button2 button2_size_s button2_width_max button2_theme_normal button2_js_inited" data-bem="{"button2":{}}"><span class="button2__text n-filter-panel-inline-3000__current-value"><span class="n-filter-block-inline__not-selected">Выберите нужные параметры</span></span><i class="icon icon_size_s icon_type_arrow icon_direction_bottom button2__icon button2__icon_side_right" aria-hidden="true"></i></button><div style="" class="n-filter-panel-inline-3000__content"><li class="n-filter-panel-inline-3000__filter" data-id="2141414264"><span class="n-filter-panel-inline-3000__filter-name n-filter-panel-inline-3000__2141414264">Процессор (подробно)<span class="n-filter-panel-inline-3000__filter-name-unit"></span></span><span class="n-filter-panel-inline-3000__filter-value-wrap n-filter-block i-bem n-filter-block_js_inited" data-id="2141414264" data-bem="{"n-filter-block":{"filterId":"2141414264"}}"><span class="n-filter-panel-inline-3000__filter-value"><div class="n-filter-block__body i-bem n-filter-block__body_js_inited" data-bem="{"n-filter-block__body": {}}"><div class="n-filter-block__list i-bem n-filter-block__list_js_inited" data-bem="{"n-filter-block__list":{}}"><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2141414264,1338895370"><span class="checkbox__box"><input class="checkbox__control" id="glf-2141414264-1338895370" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2141414264-1338895370">Intel Core i5</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2141414264,1338895372"><span class="checkbox__box"><input class="checkbox__control" id="glf-2141414264-1338895372" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2141414264-1338895372">Intel Core i7</label></span></div></div></div></span></span></li><li class="n-filter-panel-inline-3000__filter" data-id="2136921131"><span class="n-filter-panel-inline-3000__filter-name n-filter-panel-inline-3000__2136921131">Объем оперативной памяти<span class="n-filter-panel-inline-3000__filter-name-unit">, Гб</span></span><span class="n-filter-panel-inline-3000__filter-value-wrap n-filter-block i-bem n-filter-block_js_inited" data-id="2136921131" data-bem="{"n-filter-block":{"filterId":"2136921131"}}"><span class="n-filter-panel-inline-3000__filter-value"><div class="n-filter-block__body i-bem n-filter-block__body_js_inited" data-bem="{"n-filter-block__body": {}}"><div class="n-filter-block__list i-bem n-filter-block__list_js_inited" data-bem="{"n-filter-block__list":{}}"><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2136921131,8"><span class="checkbox__box"><input class="checkbox__control" id="glf-2136921131-8" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2136921131-8">8</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2136921131,16"><span class="checkbox__box"><input class="checkbox__control" id="glf-2136921131-16" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2136921131-16">16</label></span></div></div></div></span></span></li><li class="n-filter-panel-inline-3000__filter" data-id="2142398542"><span class="n-filter-panel-inline-3000__filter-name n-filter-panel-inline-3000__2142398542">Частота процессора<span class="n-filter-panel-inline-3000__filter-name-unit">, МГц</span></span><span class="n-filter-panel-inline-3000__filter-value-wrap n-filter-block i-bem n-filter-block_js_inited" data-id="2142398542" data-bem="{"n-filter-block":{"filterId":"2142398542"}}"><span class="n-filter-panel-inline-3000__filter-value"><div class="n-filter-block__body i-bem n-filter-block__body_js_inited" data-bem="{"n-filter-block__body": {}}"><div class="n-filter-block__list i-bem n-filter-block__list_js_inited" data-bem="{"n-filter-block__list":{}}"><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398542,2600"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398542-2600" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398542-2600">2600</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398542,2700"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398542-2700" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398542-2700">2700</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398542,2900"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398542-2900" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398542-2900">2900</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398542,3100"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398542-3100" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398542-3100">3100</label></span></div></div></div></span></span></li><li class="n-filter-panel-inline-3000__filter" data-id="2142398532"><span class="n-filter-panel-inline-3000__filter-name n-filter-panel-inline-3000__2142398532">Разрешение экрана<span class="n-filter-panel-inline-3000__filter-name-unit"></span></span><span class="n-filter-panel-inline-3000__filter-value-wrap n-filter-block i-bem n-filter-block_js_inited" data-id="2142398532" data-bem="{"n-filter-block":{"filterId":"2142398532"}}"><span class="n-filter-panel-inline-3000__filter-value"><div class="n-filter-block__body i-bem n-filter-block__body_js_inited" data-bem="{"n-filter-block__body": {}}"><div class="n-filter-block__list i-bem n-filter-block__list_js_inited" data-bem="{"n-filter-block__list":{}}"><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398532,126665899"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398532-126665899" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398532-126665899">2560x1440</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398532,126664101"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398532-126664101" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398532-126664101">2560x1600</label></span></div></div></div></span></span></li><li class="n-filter-panel-inline-3000__filter" data-id="2142398522"><span class="n-filter-panel-inline-3000__filter-name n-filter-panel-inline-3000__2142398522">Объем жесткого диска<span class="n-filter-panel-inline-3000__filter-name-unit">, Гб</span></span><span class="n-filter-panel-inline-3000__filter-value-wrap n-filter-block i-bem n-filter-block_js_inited" data-id="2142398522" data-bem="{"n-filter-block":{"filterId":"2142398522"}}"><span class="n-filter-panel-inline-3000__filter-value"><div class="n-filter-block__body i-bem n-filter-block__body_js_inited" data-bem="{"n-filter-block__body": {}}"><div class="n-filter-block__list i-bem n-filter-block__list_js_inited" data-bem="{"n-filter-block__list":{}}"><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398522,128"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398522-128" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398522-128">128</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398522,256"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398522-256" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398522-256">256</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398522,512"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398522-512" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398522-512">512</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398522,1000"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398522-1000" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398522-1000">1000</label></span></div></div></div></span></span></li><li class="n-filter-panel-inline-3000__filter" data-id="2142398543"><span class="n-filter-panel-inline-3000__filter-name n-filter-panel-inline-3000__2142398543">Процессор<span class="n-filter-panel-inline-3000__filter-name-unit"></span></span><span class="n-filter-panel-inline-3000__filter-value-wrap n-filter-block i-bem n-filter-block_js_inited" data-id="2142398543" data-bem="{"n-filter-block":{"filterId":"2142398543"}}"><span class="n-filter-panel-inline-3000__filter-value"><div class="n-filter-block__body i-bem n-filter-block__body_js_inited" data-bem="{"n-filter-block__body": {}}"><div class="n-filter-block__list i-bem n-filter-block__list_js_inited" data-bem="{"n-filter-block__list":{}}"><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398543,1670617603"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398543-1670617603" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398543-1670617603">Core i5</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_normal" data-bem="{"checkbox":{}}" data-filter="glf,2142398543,1670617601"><span class="checkbox__box"><input class="checkbox__control" id="glf-2142398543-1670617601" type="checkbox"><i class="checkbox__tick"></i></span><label class="checkbox__label" for="glf-2142398543-1670617601">Core i7</label></span></div></div></div></span></span></li><li class="n-filter-panel-inline-3000__filter" data-id="13887626"><span class="n-filter-panel-inline-3000__filter-name n-filter-panel-inline-3000__13887626">Цвет<span class="n-filter-panel-inline-3000__filter-name-unit"></span></span><span class="n-filter-panel-inline-3000__filter-value-wrap n-filter-block i-bem n-filter-block_js_inited" data-id="13887626" data-bem="{"n-filter-block":{"filterId":"13887626"}}"><span class="n-filter-panel-inline-3000__filter-value"><div class="n-filter-block__body i-bem n-filter-block__body_list_limited n-filter-block__body_js_inited" data-bem="{"n-filter-block__body": {}}"><div class="n-filter-block__list i-bem n-filter-block__list_js_inited" onclick="return { "n-filter-block__list":{ } }"><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_colorized" data-bem="{"checkbox":{}}" data-filter="glf,13887626,13898623"><span class="checkbox__box" style="background: #F1F1F1" data-color="#F1F1F1"><input class="checkbox__control" id="glf-13887626-13898623" type="checkbox"><i class="checkbox__tick checkbox__tick_theme_dark" data-color="#F1F1F1"></i></span><label class="checkbox__label" for="glf-13887626-13898623">серебристый</label></span></div><div class="n-filter-block__item i-bem n-filter-block__item_js_inited" data-bem="{"n-filter-block__item":{}}"><span class="checkbox checkbox_size_s i-bem checkbox_theme_colorized" data-bem="{"checkbox":{}}" data-filter="glf,13887626,13898641"><span class="checkbox__box" style="background: #666666" data-color="#666666"><input class="checkbox__control" id="glf-13887626-13898641" type="checkbox"><i class="checkbox__tick checkbox__tick_theme_light" data-color="#666666"></i></span><label class="checkbox__label" for="glf-13887626-13898641">серый</label></span></div></div></div></span></span></li></div></div></div></div>