diff --git a/football/jczq.py b/football/jczq.py index 506a78a..ec14aaa 100644 --- a/football/jczq.py +++ b/football/jczq.py @@ -6,7 +6,7 @@ from requests_html import HTML, HTMLSession import pandas as pd -from lottery.football import Foootball +from football import Foootball from model.football_match import FootballMatch from model.football_match_spf_odds import FootballMatchSpfOdd from model.football_match_bf_odds import FootballMatchBfOdd diff --git a/funds/efunds.py b/funds/efunds.py index 451682e..f942b0c 100644 --- a/funds/efunds.py +++ b/funds/efunds.py @@ -1,4 +1,8 @@ # import traceback +import sys +import os +sys.path.append(os.curdir) + from email.mime.text import MIMEText from smtplib import SMTP_SSL diff --git a/youdian.py b/youdian.py index 7ff721f..24ab814 100644 --- a/youdian.py +++ b/youdian.py @@ -1,7 +1,7 @@ # import traceback from email.mime.text import MIMEText from smtplib import SMTP_SSL - +import time from helium import * from selenium.webdriver import ChromeOptions @@ -16,6 +16,10 @@ class Chrome(object): def __enter__(self): chrome_options = ChromeOptions() chrome_options.add_argument('--no-sandbox') + # 禁用浏览器提示正在受自动化软件控制 + chrome_options.add_experimental_option('useAutomationExtension', False) + # 防止反爬 + chrome_options.add_experimental_option('excludeSwitches', ['enable-automation']) if self.headless: chrome_options.add_argument('--headless') if self.mobile: @@ -101,6 +105,7 @@ class Chrome(object): confirm = Text("确认") if not confirm.exists: wait_until(confirm.exists) + time.sleep(5) click(confirm) # 后退 back_1 = S('a.backlink') @@ -125,8 +130,6 @@ class Chrome(object): if not zx.exists: wait_until(zx.exists) click(zx) - # 普通投注-> 取消组3 - # result = ['258', '357', '069', '168', '078', '267', '159', '339', '177', '366'] for index, item in enumerate(result): if len(set(item)) == 3: click(Text('普通投注')) @@ -194,6 +197,7 @@ class Chrome(object): confirm = Text("确认") if not confirm.exists: wait_until(confirm.exists) + time.sleep(5) click(confirm) # 后退 back_1 = S('a.backlink') @@ -259,8 +263,9 @@ class Chrome(object): with Chrome() as chrome: # chrome.balance() # 组选 - result = ['058', '157', '238', '139', '278', '359', '089', '179', '138', '057'] - chrome.pls(result = result, multiple=1) + # result = ['039', '048', '049', '138', '139', '147', '237', '238', '246', '247'] + result = ['237', '057', '129', '256', '247', '049', '067', '257', '059', '267', '069', '078', '258', '058', '357'] + chrome.pls(result = result, multiple=1, save_result=False) # 直选 # result = ['246', '264', '291', '219', '169'] # chrome.pls(result=result, is_group=False) \ No newline at end of file