diff --git a/QUANTAXIS/QACmd/__init__.py b/QUANTAXIS/QACmd/__init__.py index 8ea68120e..ec90bab58 100755 --- a/QUANTAXIS/QACmd/__init__.py +++ b/QUANTAXIS/QACmd/__init__.py @@ -234,8 +234,8 @@ def do_save(self, arg): QA_SU_save_stock_list('tdx') QA_SU_save_stock_block('tdx') # QA_SU_save_stock_info('tdx') - QA_SU_save_report_calendar_his() - QA_SU_save_stock_divyield_his() + # QA_SU_save_report_calendar_his() + # QA_SU_save_stock_divyield_his() elif len(arg) == 1 and arg[0] == 'day': if QA_Setting().client.quantaxis.user_list.find({'username': 'admin'}).count() == 0: @@ -251,8 +251,8 @@ def do_save(self, arg): QA_SU_save_index_list('tdx') QA_SU_save_stock_list('tdx') QA_SU_save_stock_block('tdx') - QA_SU_save_stock_divyield_day() - QA_SU_save_report_calendar_day() + # QA_SU_save_stock_divyield_day() + # QA_SU_save_report_calendar_day() elif len(arg) == 1 and arg[0] == 'min': if QA_Setting().client.quantaxis.user_list.find({'username': 'admin'}).count() == 0: diff --git a/QUANTAXIS/QAWeb/backtesthandles.py b/QUANTAXIS/QAWeb/backtesthandles.py index add81828c..8e02ba99f 100644 --- a/QUANTAXIS/QAWeb/backtesthandles.py +++ b/QUANTAXIS/QAWeb/backtesthandles.py @@ -45,7 +45,7 @@ class BacktestHandler(QAWebSocketHandler): - + client={} def open(self): self.client.add(self) diff --git a/QUANTAXIS_CRAWLY/gecko_example.py b/QUANTAXIS_CRAWLY/gecko_example.py new file mode 100644 index 000000000..b3517dafd --- /dev/null +++ b/QUANTAXIS_CRAWLY/gecko_example.py @@ -0,0 +1,39 @@ +import time + +import pandas as pd +from selenium import webdriver + +"""这里我给了一个同花顺的页面爬虫 用于gecko_driver 也就是 火狐浏览器内核爬虫的教学 + +推荐使用火狐浏览器的内核 配置方便 +""" + +opener = webdriver.Firefox() # should make sure the gekkodriver.exe in path +data = [] + + +for item in ['gn', 'dy', 'thshy', 'zjhhy']: + opener.get('http://q.10jqka.com.cn/{}/'.format(item)) + + hpage = opener.page_source + + # opener.save_screenshot('page_gn.png') + try: + if opener.find_element_by_class_name('cate_toggle.boxShadow').text == '收起': + pass + else: + opener.find_element_by_class_name('cate_toggle.boxShadow').click() + except: + pass + + res = opener.find_elements_by_xpath('/html/body/div/div/div/div/div/a') + + data.extend([[res.text, res.get_attribute('href'), item] for res in res]) + + time.sleep(1) + + +res = pd.DataFrame(data) +print(res) +opener.close() +res.to_csv('ths.csv') diff --git a/config/update_x.py b/config/update_x.py index 2d0608009..0e8901162 100644 --- a/config/update_x.py +++ b/config/update_x.py @@ -58,6 +58,6 @@ QA_SU_save_stock_list('tdx') QA_SU_save_stock_block('tdx') QA_SU_save_stock_info('tdx') -QA_SU_save_stock_divyield_day() -QA_SU_save_report_calendar_day() +# QA_SU_save_stock_divyield_day() +# QA_SU_save_report_calendar_day()