- Регистрация
- 15.12.2011
- Сообщения
- 47
- Благодарностей
- 1
- Баллы
- 6
Hi,
There is no problem to take some content from page with regex from one line like this:
It will go like this:
(?<=<li><a\ href="http://www\.url\.com">).*(?=</a></li>)
But what about situation, where I need to take content from couple of html lines:
I need to take content located between:
<input type="text" value="search" id="searchInput" name="query" class="">
<div id="searchSelector">
<a href="http://www.url.com">
and:
</a>
<div id="searchSelBtn"></div>
</div>[/CODE]
This is just an example. I need to use more lines, because there is more of same code on website, so I need to take more html to get this one, which I need.
There is no problem to take some content from page with regex from one line like this:
Код:
<li><a href="http://www.url.com">anchor</a></li>
(?<=<li><a\ href="http://www\.url\.com">).*(?=</a></li>)
But what about situation, where I need to take content from couple of html lines:
Код:
<input type="text" value="search" id="searchInput" name="query" class="">
<div id="searchSelector">
<a href="http://www.url.com">anchor</a>
<div id="searchSelBtn"></div>
</div>
<input type="text" value="search" id="searchInput" name="query" class="">
<div id="searchSelector">
<a href="http://www.url.com">
and:
</a>
<div id="searchSelBtn"></div>
</div>[/CODE]
This is just an example. I need to use more lines, because there is more of same code on website, so I need to take more html to get this one, which I need.