Using DOM to scrape text with/without line break how ?

2xdswu

Новичок
Регистрация
03.04.2016
Сообщения
21
Благодарностей
4
Баллы
3
Hey there.
I'm scraping captions from instagram however I'm looking to scrape captions and using regular expressions with DOM is giving me issues.

For example there's over 20 photo's captions some have and some don't have line break.

I'm using this:
Код:
(?<=<img\ alt=")[\w\W]*(?="\ class="_icyx7"\ id="pImage_8")
But it only works for captions with linebreak and

if I use this:
Код:
(?<=<img\ alt=").*(?="\ class="_icyx7"\ id="pImage_8")
It'll not scrape the photo's without line break.

is it possible for me to do like [\w\W] or .* ?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)