Jump to content

Recommended Posts

hello every body,

 

Currently i'm scraping web data for a demo project but i cant preg_match the value from this html.

The html code is 
 

<div class="carouselContainer leftDisabled">
                    <ul class="carousel leftDisabled">
                            <li>
                                <div class="thumbContainer">
                                    <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzb4ywyj25mw4.jpeg)"
                                         data-imageId="IMADZB4YWYJ25MW4">
                                    </div>
                                </div>
                            </li>
                            <li>
                                <div class="thumbContainer">
                                    <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzb4zhk4855ny.jpeg)"
                                         data-imageId="IMADZB4ZHK4855NY">
                                    </div>
                                </div>
                            </li>
                            <li>
                                <div class="thumbContainer">
                                    <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzwrpmdwhnxg7.jpeg)"
                                         data-imageId="IMADZWRPMDWHNXG7">
                                    </div>
                                </div>
                            </li>
                            <li>
                                <div class="thumbContainer">
                                    <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzwvvz3deeh4c.jpeg)"
                                         data-imageId="IMADZWVVZ3DEEH4C">
                                    </div>
                                </div>
                            </li>
                    </ul>
            </div>

The regex i've used is

preg_match_all('|<div class="carouselContainer leftDisabled"+>(.*)</div+>|U',$txt,$matches3);

I want only the images images url from that specific block.

 

Can anybody help me in this plz...

Link to comment
https://forums.phpfreaks.com/topic/296450-need-help-in-regex/
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.