Jump to content

looking for a div query regex...


wilbur_wc

Recommended Posts

i'm trying to parse an html page and retrieve one div (or better yet one specific item from within the div).

 

here's the div that i'm looking for...

 

<div class="content-item ">
<div class="type">XXX</div>
<div class="title"><a href="xxxxxxx">THIS IS MY SEARCH FLAG</a></div>
<i></i>
<div class="tags"></div>
<a title="View the PDF version of this article" href="this-is-the-url-i-want-to-pull.pdf" class="pdf-link"><img alt="PDF" src="xxxxx" class="xxxx">PDF</a>
<a title="xxxx" href="xxx" class="xx"><img alt="xxxx" src="xxxxx" class="xxxxx">XXXXX</a>
</div>

 

you can see that my query constant (the only thing i can constantly depend on existing in the same format) is a string represented in the html as 'THIS IS MY SEARCH FLAG'

and the item i ultimately want to return is a url represented by 'this-is-the-url-i-want-to-pull.pdf'

 

i'm new to php and regex is always something of trial and error for me anyhow...  any help would be greatly appreciated.

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/212118-looking-for-a-div-query-regex/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.