Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]Parsowanie, prosze o pomoc bo juz niemam sily...
zee
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 12.08.2012

Ostrzeżenie: (0%)
-----


Witam....
Wypocilem cos takiego:

  1. <!-- xml version="1.0" encoding="UTF-8" -->
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <script type="text/javascript" src="http://view.binlayer.com/ad-54892.js"></script>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7.  
  8. <meta http-equiv="refresh" content="9999 url=xxx">
  9.  
  10. </head>
  11. <body>
  12. <?php echo $utf8variable;?>
  13. <body>
  14. <html>
  15. <?php
  16. $url = 'http://panoramafirm.pl/komputery_sprzeda%C5%BC'; //adres strony do przeskanowania jako lancuch znakow
  17. $ch = curl_init();
  18. curl_setopt($ch, CURLOPT_URL,$url); // ustawienie urla
  19. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // zwróć w postaci zmiennej
  20. curl_setopt($ch, CURLOPT_TIMEOUT, 3);
  21. $result = curl_exec($ch); // wykonanie skryptu
  22. curl_close($ch);
  23.  
  24. $nazwa ='@<\/.* class="js-offerName addax addax-cs_hl_hit_company_name_click">(.*?)</a></h3></td>@is';
  25. $telefon ='@<span class="phone">(.*?)</a>@is';
  26. $adres ='@<div class="left js-offerAddress">(.*?)</div> <div class="clear">@is';
  27.  
  28. $ile = preg_match_all($nazwa, $result, $matches, PREG_PATTERN_ORDER);
  29. $ile2 = preg_match_all($telefon, $result, $matches2, PREG_PATTERN_ORDER);
  30. $ile3 = preg_match_all($adres, $result, $matches3, PREG_PATTERN_ORDER);
  31.  
  32. for ($i=0; $i<40; $i++) {
  33. echo ($matches[0][$i]) . '<br>';
  34. echo ($matches2[0][$i]) . '<br>';
  35. echo ($matches3[0][$i]) . '<br>';
  36.  
  37. // print_r ($matches2[0][$i]) . '<br>';
  38. }
  39. ?>


Adres i telefon pobierany jest dobrze ale nazwa juz nie.(albo niemam nic, albo cala strona)
Niemam pojecia jak to prawidlowo zapisac, prosze o pomoc


To czesc kodu z ktorego chce wyciagnac nazwe:
  1. ś</span> </li> </ul></div> </div> <div class="listingStandardLineArea">
  2. <div class="listingStandardLine"></div> </div>
  3. <div class="listingItem searchItem searchItem-newStandardNoOffer" id="itemListing-15" rel="oygnam_fsp">
  4. <div class="fill"> <table class="table"> <tbody> <tr> <td rowspan="3" class="logoArea"> </td>
  5. <td colspan="2" class="nameArea"><h3>
  6. <a href="http://panoramafirm.pl/mazowieckie,wola,warszawa,warszawa,okopowa,47/tremark_sp._z_o.o.-oygnam_fsp.html" class="js-offerName addax addax-cs_hl_hit_company_name_click"> Tremark Sp. z o.o.</a>
  7. <div class="alternateNamesInfo"> <span class="button js-AlternateNamesPopupBtn" rel="15">
  8. <div class="bgIcons questionMark">&nbsp;&nbsp;&nbsp;&nbsp;</div></span> </div> <div class="clear"></div>
  9. <div class="AlternateNamesPopup js-AlternateNamesPopup hidden" id="js-AlternateNamesPopup-15">
  10. <div style="margin-left: 138px;" class="arrow bgKrakFill"></div> <div class="AlternateNamesPopupTop">
  11. <div class="AlternateNamesPopupHeader">Inne nazwy</div> <div class="button js-close AlternateNamesPopupClose"></div> </div>
  12. <div class="AlternateNamesPopupMiddle"> <div class="AlternateNamesContainer">
  13. <a href="http://panoramafirm.pl/tremark">tremark</a> <a href="http://panoramafirm.pl/tremark/mazowieckie,,warszawa">tremark warszawa</a>
  14. </div> </div> <div class="AlternateNamesPopupBottom"></div> </div> <div class="clear"></div></h3></td> <td rowspan="3" class="pictureArea" width="158"> <div class="pictureArea"> <div class="inside"></div> </div> </td> </tr> <tr> <td class="contactArea"><div class="inside">
  15. <div class="addressArea"> <div class="left js-offerAddress">ul


interesuje mnie: Tremark Sp. z o.o.
p.s. jestem praktycznie zielony w tym ;/
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 2.10.2025 - 16:50