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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.