Could you tell me whether regular expressions can be used to make it impossible? there are many Weibo & nbsp; there are many DIV & nbsp; I want to get the data of the two divs in each microblog: & lt; DIV & nbsp; title2013-12-03 & nbsp; 22:38:07 & gt; & nbsp; text content <div>
One page has many Weibo posts and one microblog contains many layers of divs. I want to get the data of these two divs in each microblog:
Text content
The two divs are of the same level.
I want to catch the content in class = content and the src of img;
Note that the second DIV is not necessary. some Weibo posts have images and some do not have them.
Share: More
------ Solution --------------------
We recommend that you use phpquery. it's pretty good to have a look at it two days ago... you don't need to think about those regular expressions after you have mastered the method.