diff --git a/auto.py b/auto.py index 5abb92d..635a528 100644 --- a/auto.py +++ b/auto.py @@ -22,7 +22,6 @@ click(_close) #店内账本 click(Text("店内账本")) -# vue2_el > div:nth-child(2) > section > div > div > div.pad30px.mb15.border_b.bgfff.balance_top > div:nth-child(2) > span.gray3.moneynum # moneynum = S('//*[@id="vue2_el"]/div[1]/section/div/div/div[3]/div[2]/span[1]') moneynum = S('//span[contains(@class, "gray3") and contains(@class, "moneynum")]') wait_until(moneynum.exists) @@ -126,4 +125,4 @@ plus = Text("+") confirm = Text("确认") # click(confirm) # time.sleep(5) -# kill_browser() \ No newline at end of file +kill_browser() \ No newline at end of file diff --git a/auto_v2.py b/auto_v2.py index e9be32f..e27f98d 100644 --- a/auto_v2.py +++ b/auto_v2.py @@ -10,7 +10,7 @@ chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) #chrome_options.add_experimental_option('excludeSwitches', ['enable-automation']) #chrome_options.add_experimental_option('useAutomationExtension', False) chrome_options.add_argument('--no-sandbox') -# chrome_options.add_argument('--headless') +chrome_options.add_argument('--headless') chrome_options.add_argument('user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"') driver = start_chrome("https://youdian.jindianle.com/", options=chrome_options) try: @@ -49,16 +49,16 @@ try: click(pls) wait_until(Text('组选').exists) click(Text('组选')) - # 普通投注-> 取消组3 result = ['258', '357', '069', '168', '078', '267', '159', '339', '177', '366'] for index, item in enumerate(result): if len(set(item)) == 3: + # 普通投注-> 取消组3 click(Text('普通投注')) for i in item: ball_line = S(f'//*[@id="body"]/section/div[3]/div[2]/ul/li[{int(i) + 1}]/p[1]') if ball_line.exists: - print(ball_line.web_element.text) click(ball_line) + print(ball_line.web_element.text) else: print(f"{i}不存在") wait_until(Text("组3").exists) @@ -73,15 +73,18 @@ try: single_ball = S(f'//*[@id="body"]/section/div[3]/div[2]/div[2]/ul/li[{int(item[0]) + 1}]/p') click(double_ball) click(single_ball) + print(f"对子号:{double_ball.web_element.text}") + print(f"非对子号:{single_ball.web_element.text}") print(f"{index}: {item}") wait_until(Text("下一步").exists) click(Text("下一步")) if index + 1 != len(result): wait_until(Text("+继续添加").exists) click(Text("+继续添加")) - wait_until(Text("保存").exists) + save = Text("保存") + wait_until(save.exists) click(Text("保存")) - + print(save.web_element.text) # # 设置倍数后,再点击一次下一步 # plus = Text("+") # # click(plus) diff --git a/jcbf.py b/jcbf.py new file mode 100644 index 0000000..10f3e8c --- /dev/null +++ b/jcbf.py @@ -0,0 +1,23 @@ +import requests +from furl import furl +import time +import json + +file = open("data.json", "w+") + +base_url = "https://www.ttyingqiu.com/" +f = furl(base_url) + +f.path = "/static/no_cache/league/zc/jsbf/ttyq2020/jsbf_2022-11-06.json" +f.args["v"] = int(time.time()*1000) +print(f.url) +print(r.status_code) +print(r.json()) +file.write(json.dumps(r.json())) +file.close() + + +url = "/static/no_cache/league/zc/jsbf/ttyq2020/jczq/jsbf_2022-11-06.json?v=1667799791084" +url = "https://www.ttyingqiu.com/static/no_cache/league/zc/jsbf/ttyq2020/jczq/2022-11-06/oz_407_6.json?v=1667799791169" + +match_list = data["matchList"] \ No newline at end of file diff --git a/pls.py b/pls.py index 95f4a44..16776ef 100644 --- a/pls.py +++ b/pls.py @@ -13,34 +13,34 @@ sum_df = pd.value_counts(sum_list) # 组三 group3 = [ i for i in l if len(set(i)) == 2] -sum_group_dict = {i: [] for i in np.arange(28)} +sum_group3_dict = {i: [] for i in np.arange(28)} for i in group3: - - sum_group_dict[sum(map(int, list(i)))].append(i) - -for i in sum_group_dict.keys(): - f3 = lambda number: True if '1' not in number else False - print(i, -cachesum_group_dict[i]) -# print(sum_group3_dict) -# sum_group3 = [ sum(map(int, list(i))) for i in group3] -# print(pd.value_counts(sum_group3).to_dict()) -for i in range(5, 20): - _result = [item for item in sum_group_dict[i]] + sum_group3_dict[sum(map(int, list(i)))].append(i) # 组六 group6 = [ i for i in l if len(set(i)) == 3] -print(len(group6)/220) sum_group6_dict = {i: [] for i in np.arange(28)} for i in group6: sum_group6_dict[sum(map(int, list(i)))].append(i) +# for i in sum_group3_dict.keys(): +# f3 = lambda number: True if '7' not in number else False +# print(i, list(filter(f3, sum_group3_dict[i]))) +# print(sum_group3_dict) +# sum_group3 = [ sum(map(int, list(i))) for i in group3] +# print(pd.value_counts(sum_group3).to_dict()) +# for i in range(5, 20): +# _result = [item for item in sum_group3_dict[i]] + + for i in sum_group6_dict.keys(): f1 = lambda number: len([i for i in number if int(i) %2 == 0]) != 0 f2 = lambda number: len([i for i in number if int(i) %2 == 1]) != 0 - f3 = lambda number: True if '2' not in number else False - f4 = lambda number: True if max(map(int, number)) - min(map(int, number)) != 2 else False - f5 = lambda number: True if '3' not in number else False - f3 = lambda number: True if '8' not in number else False - print(i, sum_group6_dict[i]) -# print(pd.value_counts(sum_group3).to_dict()) + f3 = lambda number: True if max(map(int, number)) - min(map(int, number)) != 2 else False + f4 = lambda number: True if '3' not in number else False + f5 = lambda number: True if '4' not in number else False + if i in [15, 19]: + result = sum_group6_dict[i]+sum_group3_dict[i] + print(i, list(filter(f5, result))) + # print(i, sum_group3_dict[i]) # 连号 result = [] diff --git a/sd.py b/sd.py index 9947fdb..b762fe9 100644 --- a/sd.py +++ b/sd.py @@ -3,14 +3,43 @@ import pandas as pd a = np.arange(1000) +nums = [ f"{i:03d}" for i in a ] +is_odd = lambda i: True if int(i) % 2 == 1 else False +is_even = lambda i: True if int(i) % 2 == 0 else False + +#奇奇奇 +odd_odd_odd = [i for i in nums if is_odd(i[0]) and is_odd(i[1]) and is_odd(i[2]) ] +#奇奇偶 +odd_odd_even = [i for i in nums if is_odd(i[0]) and is_odd(i[1]) and is_even(i[2]) ] +# +odd_even_odd = [i for i in nums if is_odd(i[0]) and is_even(i[1]) and is_odd(i[2]) ] +# +odd_even_even = [i for i in nums if is_odd(i[0]) and is_even(i[1]) and is_even(i[2])] +# +even_odd_odd = [i for i in nums if is_even(i[0]) and is_odd(i[1]) and is_odd(i[2]) ] +#奇奇偶 +even_odd_even = [i for i in nums if is_even(i[0]) and is_odd(i[1]) and is_even(i[2]) ] +# +even_even_odd = [i for i in nums if is_even(i[0]) and is_even(i[1]) and is_odd(i[2]) ] +# +even_even_even = [i for i in nums if is_even(i[0]) and is_even(i[1]) and is_even(i[2])] + +print(len(even_even_even)) +print(len(even_even_odd)) +print(len(odd_odd_even)) + +f = lambda x: True if '7' not in x and '5' not in x else False +result = list(filter(f, even_odd_even)) +print(result) + l = set([ f"{i:03d}" for i in a ]) sum_dict = dict() -print(len(l)) +# print(len(l)) for i in l: _sum = sum(map(int, i)) v = sum_dict.get(_sum, 0) sum_dict[_sum] = v + 1 df = pd.Series(sum_dict) -print(df.sort_values(ascending=False)) \ No newline at end of file +# print(df.sort_values(ascending=False)) \ No newline at end of file diff --git a/sk_test.py b/sk_test.py new file mode 100644 index 0000000..712ebbd --- /dev/null +++ b/sk_test.py @@ -0,0 +1,34 @@ +import sklearn +from sklearn import linear_model, tree + +# 普通最小二乘法 +reg = linear_model.LinearRegression() +reg.fit([[0, 0], [1, 1], [2, 2]], [0, 1, 2]) +result = reg.predict([[3, 1]]) +print(reg.coef_) +print(result) + +# 贝叶斯岭回归 +X = [[0., 0.], [1., 1.], [2., 2.], [3., 3.]] +Y = [0., 1., 2., 3.] +reg = linear_model.BayesianRidge() +reg.fit(X, Y) +result = reg.predict([[1, 0]]) +print(reg.coef_) +print(result) + +# 决策树分类 +X = [[0, 0], [1, 1]] +Y = [0, 1] +clf = tree.DecisionTreeClassifier() +clf = clf.fit(X, Y) +result = clf.predict([[10., 11.]]) +print(result) +print(clf.predict_proba([[10., 11.]])) +# 决策树回归 +X = [[0, 0], [2, 2]] +Y = [1.5, 6.5] +clf = tree.DecisionTreeRegressor() +clf = clf.fit(X, Y) +result = clf.predict([[1, 2]]) +print(result)