# -*- coding: utf-8 -*-
import json
import scrapy
class HuoBiSpider(scrapy.Spider):
name = 'huobi'
allowed_domains = ['otc-api-bj.eiijo.cn']
def start_requests(self):
yield scrapy.FormRequest(url='https://otc-api-bj.eiijo.cn/v1/data/trade-market',
formdata={'coinId': '3', 'currency': '1', 'tradeType': 'sell', 'currPage': '1',
'payMethod': '0', 'country': '37', 'blockType': 'general', 'online': '1',
'range': '0', 'amount': ''}, method='GET')
def parse(self, response):
response = json.loads(response.text)
print(response)
if __name__ == '__main__':
from scrapy import cmdline
cmdline.execute("scrapy crawl huobi".split())