1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace Ku\Spider;
- use Dever;
- class Taobao
- {
- public function rule()
- {
- return array
- (
- 'pic' => '<img id="J_ImgBooth" src="(.*?)" data-hasZoom="700" data-size="400x400"/>',
- 'name' => '<h3 class="tb-main-title" data-title="(.*?)">',
- 'price' => '<input type="hidden" name="current_price" value= "(.*?)"/>',
- );
- }
- public function link($link)
- {
- $url = parse_url($link);
- parse_str($url['query'], $query);
- if (isset($query['id'])) {
- $id = $query['id'];
- $link = 'https://item.taobao.com/item.htm?id=' . $id;
- }
- return $link;
- }
- public function replace($key, $data)
- {
- return $data;
- }
- }
|