# -*- coding: utf-8 -*-
"""
Created on Thu Oct 22 10:00:27 2020
@author: LiKely
"""
import requests
from bs4 import BeautifulSoup
from datetime import datetime
import time
import json
import xlwt
def get_list(url):
# 股票代码链接
res=requests.get(url)
res.encoding='utf-8'
# 完整HTML
html=BeautifulSoup(res.text,'html.parser')
# 股票代码列表
stockList=[]
for item in html.select('.stockTable a'):
try:
stockObj={}
stockObj['name']=item.text
stockObj['url']=item.get('href')
stockList.append(stockObj)
except:
print('出现异常')
return stockList
def get_detail(url):
# 股票链接