Sunday, 15 January 2012

php - Getting a specific URL using simple_html_dom based on the end of the URL -



php - Getting a specific URL using simple_html_dom based on the end of the URL -

i need grab url using simple_html_dom based on end of url. url has no specific class create unique. thing unique ends specific set of numbers. cannot figure out proper syntax grab specific url , print it.

any help?

example:

<table class="findlist"> <tr class="findresult odd"> <td class="primary_photo"> <a href="/title/tt0080487/?ref_=fn_al_tt_1" ><img src="http://ia.media-imdb.com/images/m/mv5bnzk2ote2njyxnf5bml5banbnxkftztywmjywndq5._v1_sy44_cr0,0,32,44_.jpg" height="44" width="32" /></a> </td>

that code origin of table. first href 1 want grab. table continues more links, etc, that's not relevant want.

for first href ending in 1:

$dom->find('a[href$="1"]', 0);

php html simple-html-dom

No comments:

Post a Comment