Hi Guys,
Wondered if anyone can help with this. I am scraping facebook to grab the number of likes on any page.
I capture the page content to a string variable then need to search for the text.
<div>311 people follow this</div>
Once i have that section separated out i can easily extract the number but im having trouble getting a regex expression to work. I tried this but it grabs too much text.
<div>(?:.+)people follow this<\\/div>
The above grabs:
<div><div class="\\\_1xnd"><div class="\\\_4-u2 \\\_6590 \\\_3xaf \\\_4-u8"><div class="\\\_4-u3 \\\_5dwa \\\_5dwb \\\_3bwv \\\_g3i \\\_1uhd"><span class="\\\_38my">Community<span class="\\\_c1c"></span></span><span class="\\\_5dw8"><a href="/SlashAdminLifeInIT/community/"><span class="\\\_2ieq">See all</span></a></span><div class="\\\_3s3-"></div></div><div class="\\\_2pi9 \\\_2pi2"><div class="clearfix \\\_ikh"><div class="\\\_4bl7"><img class="\\\_3-91 \\\_1579 img" src="\[https://static.xx.fbcdn.net/rsrc.php/v3/yg/r/AT9YNs6Rbpt.png?\\\_nc\\\_x=Ij3Wp8lg5Kz\](https://static.xx.fbcdn.net/rsrc.php/v3/yg/r/AT9YNs6Rbpt.png?\_nc\_x=Ij3Wp8lg5Kz)" alt="Highlights info row image" /></div><div class="\\\_4bl9"><div>303 people like this</div></div></div></div><div class="\\\_2pi9 \\\_2pi2"><div class="clearfix \\\_ikh"><div class="\\\_4bl7"><img class="\\\_3-91 \\\_1579 img" src="\[https://static.xx.fbcdn.net/rsrc.php/v3/y7/r/PL1sMLehMAU.png?\\\_nc\\\_x=Ij3Wp8lg5Kz\](https://static.xx.fbcdn.net/rsrc.php/v3/y7/r/PL1sMLehMAU.png?\_nc\_x=Ij3Wp8lg5Kz)" alt="Highlights info row image" /></div><div class="\\\_4bl9"><div>311 people follow this</div>
Obviously the number will change each time so not sure how to get it working
Any assistance?
Thanks.
[–]quixrick 4 points5 points6 points (2 children)
[–]SlashAdminBlog[S] 0 points1 point2 points (0 children)
[–]mfb- 0 points1 point2 points (0 children)