|
- import requests
- from pyquery import PyQuery as pq
- url = 'https://www.993dy.com/vod-type-id-1-pg-{pn}.html'
- headers = {
- 'Referer':'https://www.993dy.com/vod-type-id-1-pg-1.html',
- 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0'
- }
- for page in range(1,3):
- listurl = url.format(pn=page)
- r = requests.get(listurl,headers=headers).text
- d = pq(r)
- for i in d('.img-list li'):
- sub_d = pq(i)
- print(sub_d('h5').text(),end=' ')
- print('https://www.993dy.com'+sub_d('a').attr('href'))
复制代码
|
|