You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
436 B
16 lines
436 B
5 years ago
|
# -*- coding: utf-8 -*-
|
||
|
from scrapy import Spider, Request
|
||
|
|
||
|
|
||
|
class YiniuYunSpider(Spider):
|
||
|
name = '16yun'
|
||
|
allowed_domains = ['current-ip.16yun.cn']
|
||
|
start_url = 'http://current-ip.16yun.cn:802/ip'
|
||
|
|
||
|
def start_requests(self):
|
||
|
yield Request(self.start_url, callback=self.parse_list)
|
||
|
|
||
|
def parse_list(self, response):
|
||
|
with open('16yun.html', 'w', encoding='utf-8') as f:
|
||
|
f.write(response.text)
|