Please Help With Amazon Description RegEx

LBrown

Client
Регистрация
20.11.2011
Сообщения
6
Благодарностей
0
Баллы
0
It should be really obvious and I've been able to scrape other elements on the page but I just can't pick up the description.

So, for this page:

http://www.amazon.com/gp/product/B004X6TSOG/

the whole description is between

Код:
<div class="productDescriptionWrapper"></div class="EmptyClear">
so the RegEx should be

Код:
(?<=\<div class\=\"productDescriptionWrapper\"\>).*?(?=\<div class\=\"emptyClear\"\>)
But it doesn't work when I test it.

Can someone show me where I've gone wrong and what I need to do to fix it, please?
 

shifu

Client
Регистрация
04.04.2011
Сообщения
168
Благодарностей
23
Баллы
18
Your regexp is wrong. You need this (?<=\<div class\=\"productDescriptionWrapper\"\>).*?(?=\<\/div class\=\"EmptyClear\"\>)
 

LBrown

Client
Регистрация
20.11.2011
Сообщения
6
Благодарностей
0
Баллы
0
Thank you for your answer but when I try "Test a Regular Expression" with yours nothing comes up. I've tried with DOM HTML and Source HTML.
 

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18
You should also do \ before spaces:
(?<=\<div\ class\=\"productDescriptionWrapper\"\>).*?(?=\<\/div\ class\=\"EmptyClear\"\>)

Though the answer of shifu should work in test mode.
Make also look if <div class="productDescriptionWrapper"></div class="EmptyClear"> is correct in DOM, cause on my pc it's <div class=productDescriptionWrapper></div class=EmptyClear>
 
  • Спасибо
Реакции: LBrown

LBrown

Client
Регистрация
20.11.2011
Сообщения
6
Благодарностей
0
Баллы
0
Okay, So I tried this with Source HTML (?<=\<div\ class\=\"productDescriptionWrapper\"\>).*?(?=\<\/div\ class\=\"EmptyClear\"\>)

And this with DOM HTML (?<=\<DIV\ class\=productDescriptionWrapper\>).*(?=\<DIV\ class\=emptyClear\>)

And still nothing. Is there something wrong with the Regular expression builder? Has anyone else been able to get the Regular Expression builder to give results from these?
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
get me on skype... i will se if i can help you with this
 
  • Спасибо
Реакции: LBrown

LBrown

Client
Регистрация
20.11.2011
Сообщения
6
Благодарностей
0
Баллы
0
drvosjeca fixed it for me. Thanks to all for the help.
 

dongle132

Client
Регистрация
22.01.2011
Сообщения
35
Благодарностей
0
Баллы
0

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
which part is bothering you?
 

MD. Shamid Islam

Новичок
Регистрация
13.02.2019
Сообщения
3
Благодарностей
0
Баллы
1

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