需修改output_file变量
东方财富网 + 腾讯证券
import re
import requests
import traceback
from bs4 import BeautifulSoup
def getHtmlText(url):
try:
r = requests.get(url, timeout = 30)
r.raise_for_status
r.encoding = r.apparent_encoding
return r.text
except:
print(访问失败
2022-04-14 00:45:21
19KB
数据
爬虫
股票
1