Tmall.php 544 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Ku\Spider;
  3. use Dever;
  4. class Tmall
  5. {
  6. public function rule()
  7. {
  8. return array
  9. (
  10. 'pic' => array('<img id="J_ImgBooth" alt="(.*?)" src="(.*?)"(.*?)/>', 2),
  11. 'name' => '<img id="J_ImgBooth" alt="(.*?)" src="(.*?)" data-hasZoom="700"(.*?)/>',
  12. 'price' => '<input type="hidden" name="current_price" value= "(.*?)"/>',
  13. );
  14. }
  15. public function link($link)
  16. {
  17. return $link;
  18. }
  19. public function replace($key, $data)
  20. {
  21. return $data;
  22. }
  23. }