anonīms Posted May 7, 2013 Report Share Posted May 7, 2013 (edited) http://paste.php.lv/09738fb876a709c4bfcfb0efa42a98a3?lang=php rindiņa no 3.-15. Reāli viņas tiek izmantotas tikai, lai iegūtu img src vērtību, bet man nešķiet, ka tas nav īsti pareizi. Jo gan jau, ka ar getElementsByTagName('img') kaut kā iekšs childiem var meklēt, ne? o0 markups ir apmēram šāds: <a href="***/"> <div> <div><img></div> <div> <div>...</div> <p class="text">***s</p> </div> </div> </a> markups nenāk no manas puses un to nav iespējams mainīt Edited May 7, 2013 by anonīms Quote Link to comment Share on other sites More sharing options...
daGrevis Posted May 7, 2013 Report Share Posted May 7, 2013 Normāls nestings! Quote Link to comment Share on other sites More sharing options...
anonīms Posted May 7, 2013 Author Report Share Posted May 7, 2013 a ko es saku.. ;[ tāpat es domāju vai vai iespējams kkā, bet nu ar $child->getElementsByTagName('img') nesanāca, jo šis cik sapratu getElementsByTagName ķer tikai pa taisno no loadHTML Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted May 7, 2013 Report Share Posted May 7, 2013 Kaads browser support nepiecieshams? Nevar vienkaarshi querySelectorAll izmantot? - nee nevar jo tas ir PHP Quote Link to comment Share on other sites More sharing options...
daGrevis Posted May 7, 2013 Report Share Posted May 7, 2013 Kur, PHP? :D https://code.google.com/p/phpquery/ Quote Link to comment Share on other sites More sharing options...
rpr Posted May 7, 2013 Report Share Posted May 7, 2013 ja tev tas html ir valīds, kāpēc nepamēģini xpath un uzreiz neielādē visus vajadzīgos img kā listi? http://php.net/manual/en/class.domxpath.php Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted May 7, 2013 Report Share Posted May 7, 2013 OH tas ir PHP. Nepamaniiju - sorz ;( Quote Link to comment Share on other sites More sharing options...
draugz Posted May 7, 2013 Report Share Posted May 7, 2013 Drīkst pamēģināt https://code.google.com/p/phpquery/ darbojas tik pat labi kā jquery :) Quote Link to comment Share on other sites More sharing options...
daGrevis Posted May 7, 2013 Report Share Posted May 7, 2013 Es tak to iemetu... Quote Link to comment Share on other sites More sharing options...
draugz Posted May 7, 2013 Report Share Posted May 7, 2013 Es tak to iemetu... sorry, nepamanīju :) Quote Link to comment Share on other sites More sharing options...
anonīms Posted May 7, 2013 Author Report Share Posted May 7, 2013 eh, izdarīju +/- par rpr, bet bez xpath http://paste.php.lv/f70263e60f9e5a033478adad963bba33?lang=php vispirms savācam bildes un tad iedodam īstajā vietā. Quote Link to comment Share on other sites More sharing options...
jurchiks Posted May 29, 2013 Report Share Posted May 29, 2013 (edited) "if($node->childNodes->length == 22)" --- dude, seriously? varēji kaut pēc kādas klases vai ID skatīties, bet šitā... Nemaz nerunājot par lūpošanu cauri visiem DIV elementiem. Moš iemet HTML piemēru (pilnu, nevis to mazo bloku), lai var cilvēki izštukot kaut ko sakarīgāku? Vai linku uz lapu, kuru parsē? Edited May 29, 2013 by jurchiks Quote Link to comment Share on other sites More sharing options...
anonīms Posted May 29, 2013 Author Report Share Posted May 29, 2013 jurchiks, necel augšā vecu tēmu :) Jā, es pārbaudīju pēc garuma, jo html'am nav ne id, ne klases Quote Link to comment Share on other sites More sharing options...
jurchiks Posted May 29, 2013 Report Share Posted May 29, 2013 (edited) Ui, pardon, man vnk rādījās kā neizlasīta un zemāk visas tipa izlasītas, hz kāpēc tā. Debīli tā pēc garuma, tā ir, ka līkroči taisa saitus (par to HTML struktūru runājot)... Edited May 29, 2013 by jurchiks Quote Link to comment Share on other sites More sharing options...
anonīms Posted May 29, 2013 Author Report Share Posted May 29, 2013 Nu HTML kods nav mans. Man vienkārši nepatika, ka viņu rss feeds, nedod linku uz bildi, tādēļ izdomāju, ka savākšu rakstus no viņu arhīva, kur ir titulbilde ;] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.