//开通淘宝1 private void BT_ZFB_REG_TB_open_Click(object sender, EventArgs e) { state = BusinessStatus.zfb_reg_taobao_new_alipay_q; FindTitleAndLoadHrefByJS("开通"); //var href = FindTitleHref("开通"); //if (href != "") { // NewTab(href); //} //if (isThreadStart) { // return; //} //isThreadStart = true; new Thread(() => { currentHaoZi.opentbTime++; if (currentHaoZi.opentbTime < 12) { Thread.Sleep(1000 * 3); if (MainCefFrame.Url.Contains(GlobalVar.zfb_reg_taobao_new_alipay_q)) { LogManager.WriteLog("已经进入 页面:" + borrowTitle); } else { state = BusinessStatus.zfb_reg_account_reg_success; LogManager.WriteLog("重新试试:{0}".With(currentHaoZi.opentbTime)); MainCefFrame.LoadUrl("https://my.alipay.com/portal/account/index.htm"); // break; } } }).Start(); }
private void BT_Zfb_reg_fill_Click(object sender, EventArgs e) { if (currentHaoZi.isLoadedCompetedFillLink) { return; } currentHaoZi.isLoadedCompetedFillLink = true; state = BusinessStatus.zfb_Reg_paymethod; string js1 = "document.getElementById('queryPwd').value='{0}';document.getElementById('queryPwdConfirm').value='{0}';".With(currentHaoZi.zfbPwd) + "document.getElementById('payPwd').value='{0}';document.getElementById('payPwdConfirm').value='{0}'; ".With(currentHaoZi.zfbPayPwd) + "document.getElementById('realName').value='{0}';".With(currentHaoZi.realname) + "document.getElementById('IDCardNo').value='{0}';".With(currentHaoZi.zfbSFZ) + "document.getElementById('J-complete-form').submit();"; MainCefFrame.ExecuteJavaScript(js1, MainCefFrame.Url, 0); return; #region 废弃 //document.getElementById('queryPwd').focus(); //document.getElementById('queryPwd').value = "aqq6611"; //document.getElementById('queryPwd').blur(); //密码id //queryPwd //CefFrameHelper.SetElementValueById(MainCefFrame, "queryPwd", currentHaoZi.zfbPwd); //var host = MainCefFrame.Browser.GetHost(); //foreach (var c in Debug_keyBord) { // // little hacky // host.SendKeyEvent(new CefKeyEvent { // EventType = CefKeyEventType.Char, // Modifiers = CefEventFlags.None, // WindowsKeyCode = c, // NativeKeyCode = c, // Character = c, // UnmodifiedCharacter = c, // }); //} //MainCefFrame.ExecuteJavaScript("document.getElementById('queryPwd').blur(); ", MainCefFrame.Url, 0); ////确认密码id //queryPwdConfirm //CefFrameHelper.SetElementValueById(MainCefFrame, "queryPwdConfirm", currentHaoZi.zfbPwd); ////支付密码 //PayPwd //CefFrameHelper.SetElementValueById(MainCefFrame, "PayPwd", currentHaoZi.zfbPayPwd); ////确认支付密码//payPwdConfirm //CefFrameHelper.SetElementValueById(MainCefFrame, "payPwdConfirm", currentHaoZi.zfbPayPwd); ////名字//realName //CefFrameHelper.SetElementValueById(MainCefFrame, "realName", currentHaoZi.realname); ////ShenFenZheng//IDCardNo //CefFrameHelper.SetElementValueById(MainCefFrame, "IDCardNo", currentHaoZi.zfbSFZ); #endregion }
private void jishi_next_Click(object sender, EventArgs e) { currentpage = currentpage + 1; //http://jishi.woniu.com/9yin/historicalJsonData.html?pageIndex=1&_=1447230525600 var url_next = "http://jishi.woniu.com/9yin/{0}.html?pageIndex={1}".With(modeList[modeListIndex], currentpage); Console.WriteLine("next :" + currentpage + ": " + url_next); MainCefFrame.LoadUrl(url_next); }
//测试 js 调用c#的方法 private void toolStripMenuItem4_Click(object sender, EventArgs e) { string js1 = "js2csharp('{0}');".With("statue=ready&method=testmethod&result=1"); MainCefFrame.ExecuteJavaScript(GlobalVar.base_js + js1, MainCefFrame.Url, 0); //statue=ready&method=testmethod&result=1 }
private void BT_WY_FillAccount_Click(object sender, EventArgs e) { state = BusinessStatus.wy_163_vcode; //切换字母邮箱注册 MainCefFrame.ExecuteJavaScript("_Global.main.turnOn();", MainCefFrame.Url, 0); // CefFrameHelper.SetElementValueById(MainCefFrame, "nameIpt", currentHaoZi.zfbEmail); //密码 CefFrameHelper.SetElementValueById(MainCefFrame, "mainPwdIpt", currentHaoZi.tbPwd); //确认密码 CefFrameHelper.SetElementValueById(MainCefFrame, "mainCfmPwdIpt", currentHaoZi.tbPwd); }
/// <summary> /// 加载分析 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void jishi_load_selling_Click(object sender, EventArgs e) { jishi_start = true; modeList.Clear(); modeList.Add("findSellingGoods"); modeList.Add("historicalJsonData"); modeList.Add("findNoticeGoods"); // mode = modeList[0]; currentpage = 0; modeListIndex = 0; MainCefFrame.LoadUrl("http://jishi.woniu.com/9yin/{0}.html".With(modeList[modeListIndex])); //Thread.Sleep(TimeSpan.FromSeconds(5)); //MainCefFrame.LoadUrl("http://jishi.woniu.com/9yin/{0}.html".With(modeList[modeListIndex])); }
// private void BT_ZFB_TB_Reg_Click(object sender, EventArgs e) { state = BusinessStatus.zfb_reg_account_reg_success; MainCefFrame.LoadUrl(GlobalVar.ZFB_REG_bindassetcard); // var linkList = CefFrameHelper.GetUrlListByHap(MainCefFrame, "先跳过,注册成功"); //if (linkList.Count > 0) { // MainCefFrame.LoadUrl(linkList[0]); //} else //{ // LB_Debug_info.Text = "没有找到注册的链接"; //} // state = BusinessStatus.zfb_reg_taobao_open; // MainCefFrame.LoadUrl(GlobalVar.zfb_reg_taobao_open); }
private void finishOneShop(object sender, LoadEndEventArgs eventHandler) { //1.计算是否完成X次购买 if (shoppingIndex >= int.Parse(ConfigHelper.GetValue("shoppingCount"))) { taskRunner.ReportAccount("sucess"); ClearAndPrepareNext(); } else { state = BusinessStatus.gerenzhongxin; MainCefFrame.LoadUrl("http://h5.m.taobao.com/awp/mtb/mtb.htm"); } shoppingIndex++; //2.完成则切换下一个,未完成则 }
private void BT_FindActiveUrl_Click(object sender, EventArgs e1) { string htmlbody = ""; ShowStatus("收取邮件中,稍等"); Application.DoEvents(); for (int i = 0; i < 5; i++) { Thread.Sleep(5000); List <string> titles = new List <string>(); titles.Add("新用户确认通知信"); titles.Add("请激活您的支付宝账户"); htmlbody = GetMailFromZfb(titles); if (string.IsNullOrEmpty(htmlbody)) { ShowStatus("暂未收到邮件,5秒后重试,第{0}次".With(i)); Application.DoEvents(); } else { break; } } //ap 找到激活码 string innertext = "register_confirm"; string activZfbLink1 = mcClient.GetHrefFormHtml(htmlbody, innertext); if (activZfbLink1.Contains(innertext)) { // throw new Exception("未能从邮件中找到链接!"); //GlobalVar.activZfbLink = activZfbLink1; //继续注册 // BT_Link_Continue_Reg_Click(sender, e1); MainCefFrame.LoadUrl(activZfbLink1); } else { activZfbLink1 = "没找到链接哎。。囧了。别急"; } ShowStatus(activZfbLink1); }
private void FindTitleAndLoadHref(string linkTitle) { Application.DoEvents(); for (int i = 0; i < 3; i++) { var linkList = CefFrameHelper.GetUrlListByHap(MainCefFrame, linkTitle); if (linkList.Count > 0) { MainCefFrame.LoadUrl(linkList[0]); break; } else { LB_Debug_info.Text = linkTitle; LogManager.WriteLog("没有找到 {0}".With(linkTitle)); Application.DoEvents(); } } }
private void BT_WY_Reg_Click(object sender, EventArgs e) { state = BusinessStatus.wy_163_begin; MainCefFrame.LoadUrl(GlobalVar.Wy163Reg_enter_1); }
public void BT_Reg_zfb_Click(object sender, EventArgs e) { state = BusinessStatus.zfb_reg_begin; MainCefFrame.LoadUrl(GlobalVar.zfb_Reg_enter_1); }
private void Init_tb_reg() { if (IsInit_tb_loaded) { return; } IsInit_tb_loaded = true; //填会员信息 Operation new_register = new Operation(MainCefFrame) { CurrentUrl = "http://reg.taobao.com/member/new_register.jhtml", index = 1, PerviousStatus = BusinessStatus.new_register, NextStatus = BusinessStatus.new_cellphone_reg_two, }; new_register.OperationHandler += (s, e) => { #region ==========填会员信息========== //获取ID=J_CheckCode 的data-imgurl属性的值url //识别url中的图片 new Thread(() => { string srcs = ""; for (int i = 0; i < 3; i++) { srcs = CefFrameHelper.GetUrlListByHapId(MainCefFrame, "J_CheckCode", "div", "data-imgurl").FirstOrDefault(); if (!string.IsNullOrEmpty(srcs)) { break; } } if (string.IsNullOrEmpty(srcs)) { LogManager.WriteLog("重复3次后仍然无法获取图片。"); return; } srcs = srcs.Replace("&", "&"); string returnMess; var isVCodeOk = Vcode.GetVcodeFormImageUrl(srcs, out returnMess); Console.WriteLine(isVCodeOk); // string js2run = "document.getElementById('J_Nick').value='{0}';".With(currentHaoZi.tbName) + "document.getElementById('J_Pwd').value='{0}';".With(currentHaoZi.tbPwd) + "document.getElementById('J_RePwd').value='{0}';".With(currentHaoZi.tbPwd) + "document.getElementById('J_Code').value='{0}';".With(returnMess) + "document.getElementById('J_BtnBasicInfoForm').click();"; CefFrameHelper.ExcuteJs(MainCefFrame, js2run); }).Start(); #endregion }; //验证账户信息-选择方式(手机或邮箱) Operation new_cellphone_reg_two = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.new_cellphone_reg_two, NextStatus = BusinessStatus.new_email_reg_two, CurrentUrl = "http://reg.taobao.com/member/new_cellphone_reg_two.jhtml", index = 2 }; new_cellphone_reg_two.OperationHandler += (s, e) => { // BeginInvoke(new Action(() => { FindTitleAndLoadHref("使用邮箱验证"); // })); }; //验证账户信息-选择方式(手机或邮箱)-输入邮箱手机打码 Operation new_email_reg_three = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.new_email_reg_two, NextStatus = BusinessStatus.new_email_reg_three, CurrentUrl = "http://reg.taobao.com/member/new_email_reg_two.jhtml", index = 3 }; new_email_reg_three.OperationHandler += (s, e) => { string js2runS1 = "document.getElementById('J_Email').value='{0}';".With(currentHaoZi.zfbEmail) + "document.getElementsByClassName('btn-b tsl')[0].click();"; CefFrameHelper.ExcuteJs(MainCefFrame, js2runS1); this.bfForms.BT_TB_ChangeTel_Click(s, e); }; //验证账户信息-选择方式(手机或邮箱)-获取激活链接 Operation register_confirm = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.new_email_reg_three, NextStatus = BusinessStatus.regitster_confirm, CurrentUrl = "http://reg.taobao.com/member/new_email_reg_three.jhtml", index = 4 }; register_confirm.OperationHandler += BT_FindActiveUrl_Click; //验证用户信息-完成 Operation account_management = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.regitster_confirm, NextStatus = BusinessStatus.account_management, CurrentUrl = "http://reg.taobao.com/member/register_confirm.jhtml", //https://lab.alipay.com/user/reg/complete/completeTaobao.htm index = 5 }; account_management.OperationHandler += (s, e) => { MainCefFrame.LoadUrl("http://member1.taobao.com/member/fresh/account_management.htm"); }; Operation completeTaobao = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.account_management, NextStatus = BusinessStatus.paymethod, CurrentUrl = "http://member1.taobao.com/member/fresh/account_management.htm", index = 6 }; completeTaobao.OperationHandler += (s, e) => { FindTitleAndLoadHref("立即补全"); }; Operation paymethod = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.paymethod, NextStatus = BusinessStatus.zfb_Reg_paymethod, index = 7, CurrentUrl = "https://memberprod.alipay.com/account/reg/complete/complete.htm?scene=havanaComplete" }; paymethod.OperationHandler += BT_TB_FILLZFB_Click; //===================支付宝注册流程 Operation Zfb_Fill_Account = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.zfb_reg_begin, NextStatus = BusinessStatus.emailCheck, CurrentUrl = GlobalVar.zfb_Reg_enter_1, index = 1, Deadline = 1000 * 60 * 5 }; Zfb_Fill_Account.OperationHandler += BT_Zfb_Fill_Account_Click; Operation emailCheck = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.emailCheck, NextStatus = BusinessStatus.zfb_reg_link_complete, CurrentUrl = "https://memberprod.alipay.com/account/reg/emailCheck.htm", index = 1.1 }; emailCheck.OperationHandler += (s, e) => { BT_Zfb_Reg_Sumbit_s1_Click(this, new EventArgs()); }; Operation zfb_reg_link_complete = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.zfb_reg_link_complete, NextStatus = BusinessStatus.zfb_Reg_paymethod, CurrentUrl = GlobalVar.zfb_Reg_linkcomplete, index = 2 }; zfb_reg_link_complete.OperationHandler += BT_Zfb_reg_fill_Click; Operation zfb_Reg_paymethod = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.zfb_Reg_paymethod, NextStatus = BusinessStatus.zfb_reg_account_reg_success, CurrentUrl = GlobalVar.zfb_Reg_paymethod, index = 3 }; zfb_Reg_paymethod.OperationHandler += BT_ZFB_TB_Reg_Click; Operation zfb_reg_account_reg_success = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.zfb_reg_account_reg_success, NextStatus = BusinessStatus.zfb_reg_account_reg_success, CurrentUrl = GlobalVar.zfb_reg_account_reg_success, index = 4, note = " 导航至添加密保,跳到 开通淘宝" }; //zfb_reg_account_reg_success.OperationHandler += BT_ZFB_REG_nav2addsq_Click; // BT_ZFB_REG_Account_Sucess_Click zfb_reg_account_reg_success.OperationHandler += BT_ZFB_REG_Account_Sucess_Click; Operation zfb_reg_skip_bindassetcard = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.zfb_reg_account_reg_success, //NextStatus = BusinessStatus.zfb_reg_taobao_open,//换 NextStatus = BusinessStatus.zfb_reg_nav2set_add_SecurityQuestion_before, CurrentUrl = GlobalVar.zfb_reg_skip_bindassetcard, index = 5 }; zfb_reg_skip_bindassetcard.OperationHandler += BT_ZFB_REG_TB_open_Click; Operation zfb_reg_taobao_new_alipay_q = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.zfb_reg_taobao_new_alipay_q, NextStatus = BusinessStatus.nav2deliver_address, CurrentUrl = GlobalVar.zfb_reg_taobao_new_alipay_q, index = 31, note = "开通tb", Deadline = int.Parse(ConfigHelper.GetValue("zfb_reg_taobao_new_alipay_RegDeadline")) * 60 * 1000 }; zfb_reg_taobao_new_alipay_q.OperationHandler += BT_ZFB_REG_TB_new_alipay_q_Click; Operation nav2deliver_address = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.nav2deliver_address, NextStatus = BusinessStatus.deliver_address, CurrentUrl = "http://reg.taobao.com/member/register_confirm.jhtml", index = 32, note = "注册完成-跳转->添加收货地址的页面" }; nav2deliver_address.OperationHandler += (s, e) => { MainCefFrame.LoadUrl( "http://member1.taobao.com/member/fresh/deliver_address.htm"); }; Operation add_deliver_address = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.deliver_address, NextStatus = BusinessStatus.ready, CurrentUrl = "http://member1.taobao.com/member/fresh/deliver_address.htm", index = 33, note = "添加收货地址", }; add_deliver_address.Deadline = GlobalVar.DeadLineOfChangeClearAndPrepareNext; add_deliver_address.OperationHandler += (s, e) => { var js2run = RandomAddressPlace(); CefFrameHelper.ExcuteJs(MainCefFrame, js2run); new Thread(() => { currentHaoZi.regStatus = DateTime.Now.ToString(); currentHaoZi.tbStatus = GlobalVar.CurrentIp; HaoziHelper.UpdateLoadHaozi(ConfigHelper.GetValue("WebSite"), currentHaoZi, "add"); // Thread.Sleep(6000); LogManager.WriteLog("开始下一个"); ClearAndPrepareNext(); }).Start(); }; this.opsList.Add(Zfb_Fill_Account); this.opsList.Add(emailCheck); this.opsList.Add(zfb_reg_link_complete); this.opsList.Add(zfb_Reg_paymethod); this.opsList.Add(zfb_reg_account_reg_success); this.opsList.Add(zfb_reg_skip_bindassetcard); this.opsList.Add(zfb_reg_taobao_new_alipay_q); this.opsList.Add(nav2deliver_address); this.opsList.Add(add_deliver_address); this.opsList.Add(new_register); this.opsList.Add(new_cellphone_reg_two); this.opsList.Add(new_email_reg_three); this.opsList.Add(register_confirm); this.opsList.Add(account_management); this.opsList.Add(completeTaobao); this.opsList.Add(paymethod); }
public void lead2tbV3reg() { state = BusinessStatus.Tb_reg_v3_member_reg_fill_mobile_before; MainCefFrame.LoadUrl("http://reg.taobao.com/member/new_register.jhtml"); this.Activate(); }
private void tbV3_Init_reg() { if (IsInit_tbV3_loaded) { return; } IsInit_tbV3_loaded = true; Operation fill_mobile = new Operation(MainCefFrame) { CurrentUrl = "http://reg.taobao.com/member/reg/fill_mobile.htm", index = 1.1, PerviousStatus = BusinessStatus.Tb_reg_v3_member_reg_fill_mobile_before, NextStatus = BusinessStatus.Tb_reg_v3_member_reg_fill_mobile, }; fill_mobile.OperationHandler += (s, e) => { string js2run = "document.getElementsByClassName('f12')[1].getElementsByTagName('a')[0].click()"; CefFrameHelper.ExcuteJs(MainCefFrame, js2run); }; //填会员信息 Operation new_register = new Operation(MainCefFrame) { CurrentUrl = "http://reg.taobao.com/member/reg/fill_email.htm", index = 1.2, PerviousStatus = BusinessStatus.Tb_reg_v3_member_reg_fill_mobile, NextStatus = BusinessStatus.Tb_reg_v3_member_reg_fill_email, Deadline = ConfigHelper.GetIntValue("TBV3注册第一步耗时") * 1000 * 60, }; new_register.OperationHandler += (s, e) => { #region ==========填会员信息&过手机验证========== //获取ID=J_CheckCode 的data-imgurl属性的值url //识别url中的图片 string js3run = "document.getElementById('J_CheckCodeInput').focus();"; CefFrameHelper.ExcuteJs(MainCefFrame, js3run); new Thread(() => { Thread.Sleep(ConfigHelper.GetIntValue("等待验证码时间(秒)") * 1000); var isVCodeOk = false; for (int j = 0; !isVCodeOk && j < 3; j++) { bool vcodeFrom51 = false; string srcs = ""; for (int i = 0; i < 3; i++) { //srcs = CefFrameHelper.GetUrlListByHapId(MainCefFrame, "J_CheckCodeContainer", "div", "data-imgurl").FirstOrDefault(); srcs = CefFrameHelper.GetUrlListByHapId(MainCefFrame, "J_CheckCodeImg1", "img", "src").FirstOrDefault(); srcs = srcs.Replace("&", "&"); if (!string.IsNullOrEmpty(srcs)) { break; } } if (string.IsNullOrEmpty(srcs)) { LogManager.WriteLog("重复3次后仍然无法获取图片。"); return; } string returnMess; vcodeFrom51 = Vcode.GetVcodeFormImageUrl(srcs, out returnMess); if (!vcodeFrom51) { continue; } string js2run = "document.getElementById('J_Email').value='{0}';".With(currentHaoZi.zfbEmail) + "document.getElementById('J_CheckCodeInput').value='{0}';".With(returnMess) + "document.getElementById('J_BtnEmailForm').click();"; CefFrameHelper.ExcuteJs(MainCefFrame, js2run); #region ==================过验证码==================== new Thread(() => { Thread.Sleep(3000); var res = ""; for (int i = 0; i < 3; i++) { res = CefFrameHelper.GetMsgByJs(MainCefFrame, "document.getElementById('J_MobileCheck').getAttribute('style')"); if (!string.IsNullOrEmpty(res)) { break; } Thread.Sleep(1000); } if (res.Contains("block")) { isVCodeOk = true; } checkVcodeOkEvent.Set(); }).Start(); checkVcodeOkEvent.Reset(); checkVcodeOkEvent.WaitOne(9000); #endregion if (isVCodeOk) { break; } } //手机验证 new Thread(() => { try { phoneVailed(state); } catch (Exception e2) { LogManager.WriteLog(e2.StackTrace + e2.ToString()); } }).Start(); // }).Start(); #endregion }; //账户注册-1.设置登录名-接收邮件 Operation email_sent = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_member_reg_fill_email, NextStatus = BusinessStatus.Tb_reg_v3_member_reg_email_sent, CurrentUrl = "http://reg.taobao.com/member/reg/email_sent.htm", index = 2, note = "账户注册-1.设置登录名-接收邮件" }; email_sent.OperationHandler += (s, e) => { // BeginInvoke(new Action(() => { Thread.Sleep(5000); var url = EmailCheck("新用户确认通知信", "request_dispatcher.htm"); MainCefFrame.LoadUrl(url); // })); }; Operation fill_user_info = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_member_reg_email_sent, NextStatus = BusinessStatus.Tb_reg_v3_Member_reg_fill_user_info, CurrentUrl = "http://reg.taobao.com/member/reg/fill_user_info.htm", index = 3, note = "账户注册-2.填写账户信息" }; fill_user_info.OperationHandler += (s, e) => { string js2runS1 = "document.getElementById('J_Password').value='{0}';".With(currentHaoZi.tbPwd) + "document.getElementById('J_RePassword').value='{0}';".With(currentHaoZi.tbPwd) + "document.getElementById('J_Nick').value='{0}';".With(currentHaoZi.tbName) + "document.getElementById('J_BtnInfoForm').click();"; CefFrameHelper.ExcuteJs(MainCefFrame, js2runS1); }; Operation login_unusual = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_Member_reg_fill_user_info, NextStatus = BusinessStatus.Tb_reg_v3_member_reg_reg_success, CurrentUrl = "http://login.taobao.com/member/login_unusual.htm", //http://login.taobao.com/member/login_unusual.htm index = 4.1, note = "登录身份验证 ", }; login_unusual.OperationHandler += (s, e) => { toolStripMenuItem20_Click(this, new EventArgs());//过登录验证 }; Operation member_reg_reg_success = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_Member_reg_fill_user_info, NextStatus = BusinessStatus.Tb_reg_v3_member_reg_reg_success, CurrentUrl = "http://reg.taobao.com/member/reg/reg_success.htm", index = 4.2, note = "淘宝注册成功 填写收货地址", }; member_reg_reg_success.OperationHandler += (s, e) => { //var url = "http://member1.taobao.com/member/fresh/account_management.htm"; var url = "http://member1.taobao.com/member/fresh/deliver_address.htm"; MainCefFrame.LoadUrl(url); }; Operation deliver_address = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_member_reg_reg_success, NextStatus = BusinessStatus.Tb_reg_v3_deliver_address, CurrentUrl = "http://member1.taobao.com/member/fresh/deliver_address.htm", index = 33, note = "添加收货地址 判断是否激活支付宝 ", }; deliver_address.OperationHandler += (s, e) => { var js2run = RandomAddressPlace(); CefFrameHelper.ExcuteJs(MainCefFrame, js2run); new Thread(() => { Application.DoEvents(); Thread.Sleep(3000); bool activeZFB = ConfigHelper.GetBoolValue("是否激活支付宝"); if (activeZFB) { var url = "http://member1.taobao.com/member/fresh/account_management.htm"; MainCefFrame.LoadUrl(url); } else { FinishOneResgister(); } }).Start(); }; Operation member_fresh_account_management = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_deliver_address, NextStatus = BusinessStatus.Tb_reg_v3_member_fresh_account_management, CurrentUrl = "http://member1.taobao.com/member/fresh/account_management.htm", index = 5, note = "找到 包含 立即补全 的链接 前往" }; member_fresh_account_management.OperationHandler += (s, e) => { string js2runS1 = "document.getElementsByClassName('kv_item')[2].getElementsByTagName('a')[0].click();"; CefFrameHelper.ExcuteJs(MainCefFrame, js2runS1); }; Operation account_reg_complete_complete = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_member_fresh_account_management, NextStatus = BusinessStatus.Tb_reg_v3_account_reg_complete_complete, CurrentUrl = "https://memberprod.alipay.com/account/reg/complete/complete.htm", index = 6, note = "开通支付宝 填支付密码" }; account_reg_complete_complete.OperationHandler += (s, e) => { string js2runS1 = " document.getElementById('queryPwd').value='{0}';".With(currentHaoZi.zfbPwd) + "document.getElementById('queryPwdConfirm').value='{0}';".With(currentHaoZi.zfbPwd) + "document.getElementById('payPwd').value='{0}';".With(currentHaoZi.zfbPayPwd) + "document.getElementById('payPwdConfirm').value='{0}';".With(currentHaoZi.zfbPayPwd) + "document.getElementById('realName').value='{0}';".With(currentHaoZi.realname) + "document.getElementById('IDCardNo').value='{0}';".With(currentHaoZi.zfbSFZ) + "document.getElementById('J-complete-form').submit();"; CefFrameHelper.ExcuteJs(MainCefFrame, js2runS1); }; Operation asset_paymethod_paymethod = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_account_reg_complete_complete, NextStatus = BusinessStatus.Tb_reg_v3_asset_paymethod_paymethod, CurrentUrl = "https://zht.alipay.com/asset/paymethod/paymethod.htm", index = 7 }; asset_paymethod_paymethod.OperationHandler += (s, e) => { MainCefFrame.LoadUrl("https://benefitprod.alipay.com/asset/paymethod/bindassetcard.htm"); }; Operation account_reg_success = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.Tb_reg_v3_asset_paymethod_paymethod, NextStatus = BusinessStatus.Tb_reg_v3_account_reg_success, CurrentUrl = "https://memberprod.alipay.com/account/reg/success.htm", index = 8, note = "开通支付宝成功" }; account_reg_success.OperationHandler += (s, e) => { // new Thread(() => { FinishOneResgister(); // }).Start(); }; this.opsList.Add(fill_mobile); this.opsList.Add(new_register); this.opsList.Add(email_sent); this.opsList.Add(login_unusual); this.opsList.Add(fill_user_info); this.opsList.Add(member_reg_reg_success); this.opsList.Add(deliver_address); this.opsList.Add(member_fresh_account_management); this.opsList.Add(account_reg_complete_complete); this.opsList.Add(asset_paymethod_paymethod); this.opsList.Add(account_reg_success); }
/// <summary> /// 每次都执行 /// </summary> private void OnPageLoaded_JiShi() { if (!jishi_start) { return; } var current_url = MainCefFrame.Url; if (!current_url.Contains("Goods") && !current_url.Contains("historicalJsonData") && !current_url.Contains("tradeItemDetail")) { return; } Domvisi2T dom1 = new Domvisi2T(); MainCefFrame.GetSource(dom1); var htm = GlobalVar.CurrentHtml; if (string.IsNullOrEmpty(htm)) { return; } ////角色分析模式 //if (analysisModel == "role") { // //数据导出 // LogManager.WriteLog("role-" + DateTime.Now.ToFileTime().ToString(), htm); // return; //} //物品分析模式 //0 数据过滤 htm = htm.Replace("<html><head></head><body>", ""); htm = htm.Replace("</body></html>", ""); htm = htm.Replace("</div>", ""); htm = htm.Replace("</font>", ""); // File.WriteAllText("tempload/temp_download-{0}.txt".With(DateTime.Now.ToFileTime()), htm); try { string s1 = ""; s1 = Regex.Replace(htm, "itemDesc\":\"(.*?)\",\"itemName", "itemDesc\":\"nothing\",\"itemName"); s1 = Regex.Replace(s1, "itemDesc\":\"(.*?)\",\"itemSellerRole", "itemDesc\":\"nothing\",\"itemSellerRole"); //itemSellerRole s1 = s1.Remove(0, 1); s1 = s1.Remove(s1.Length - 1, 1); //1.抽数据 JishiObject js1 = JsonConvert.DeserializeObject(s1, typeof(JishiObject)) as JishiObject; JiShi.BLL.js_item Bll = new JiShi.BLL.js_item(); foreach (var item in js1.pagedata) { #region MyRegion JiShi.Model.js_item model = new JiShi.Model.js_item(); model.closed = item.closed; model.createDate = item.createDate; model.gameId = item.gameId; model.gameItemId = item.gameItemId; model.gender = item.gender; model.gradeName = item.gradeName; model.guild = item.guild; model.iconPath = item.iconPath; model.itemCode = item.itemCode; model.itemDesc = item.itemDesc; model.itemName = item.itemName; model.itemType = item.itemType; model.power = item.power; model.publicityEndDate = item.publicityEndDate; model.sellerCasId = item.sellerCasId; model.sellerGameId = item.sellerGameId; model.sellerRole = item.sellerRole; model.serverId = item.serverId; //serverid部分数据会丢失 model.status = item.status; model.curId = item.curId; model.grade = item.grade; model.id = item.id; model.itemAmount = item.itemAmount.ToString(); model.price = item.price; model.returnDate = item.returnDate; model.saveTime = item.saveTime; model.shelfDate = item.shelfDate; model.shelfDays = item.shelfDays; model.closed = item.unitPrice; #endregion //为了对付 最近成交模式 if (model.id == null) { model.id = model.gameItemId; } // if (!Bll.Exists(model.id)) { model.status = modeList[modeListIndex]; LogManager.WriteLog("保存:" + model.gameId + " " + model.itemName + " " + Bll.Add(model)); } else { // LogManager.WriteLog("更新:" + model.gameId + " " + model.itemName + " " + Bll.Update(model)); } } //2.翻页 // Thread.Sleep(TimeSpan.FromSeconds(RandomManager.random.Next(2,4))); if (modeList[modeListIndex] == "historicalJsonData") { js1.pageInfo.totalPages = 6;//historicalJsonData模式下最多只能抓取6页 } Console.WriteLine("类型:" + modeList[modeListIndex] + " 页码:" + js1.pageInfo.pageId + " 总页数:" + js1.pageInfo.totalPages); if (js1.pageInfo.pageId < js1.pageInfo.totalPages) { jishi_next.PerformClick(); } else { if (modeListIndex + 1 < modeList.Count) { modeListIndex++; currentpage = -1; jishi_next.PerformClick(); } else { jishi_start = false; } } } catch (Exception e) { LogManager.WriteLog(e.ToString()); } }
//注册成功 private void BT_ZFB_REG_Account_Sucess_Click(object sender, EventArgs e) { state = BusinessStatus.Zfb_reg_shifou_bangding_shouji_before; MainCefFrame.LoadUrl("https://my.alipay.com/portal/account/index.htm"); }
//添加密保成功 private void Add_SQ_SUCESS(object sender, EventArgs e) { state = BusinessStatus.zfb_reg_open_tb_before; MainCefFrame.LoadUrl(GlobalVar.zfb_reg_skip_bindassetcard);//开通淘宝 }
private void InitZfbSQ() { if (IsInitZfbSQloaded) { return; } IsInitZfbSQloaded = true; // 导航至添加密保(选择添加密保的方式) Operation zfb_reg_queryStrategy = new Operation(MainCefFrame); zfb_reg_queryStrategy.index = 21; zfb_reg_queryStrategy.PerviousStatus = BusinessStatus.zfb_reg_nav2set_add_SecurityQuestion_before; zfb_reg_queryStrategy.CurrentUrl = "https://accounts.alipay.com/console/queryStrategy.htm?site=1&page_type=fullpage&sp=1-addSecurityQuestion-fullpage&scene_code=addSecurityQuestion"; zfb_reg_queryStrategy.NextStatus = BusinessStatus.zfb_reg_nav2set_add_SecurityQuestion; zfb_reg_queryStrategy.OperationHandler += (s, e) => { MainCefFrame.LoadUrl(GlobalVar.zfb_reg_nav2set_SecurityQuestion); }; //导航至支付宝密保 Operation nav2set_SQ = new Operation(MainCefFrame); nav2set_SQ.index = 22; nav2set_SQ.PerviousStatus = BusinessStatus.zfb_reg_nav2set_add_SecurityQuestion;// nav2set_SQ.NextStatus = BusinessStatus.zfb_reg_nav2set_SecurityQuestion; nav2set_SQ.OperationHandler += BT_zfb_reg_nav2set_SecurityQuestion_Click; nav2set_SQ.CurrentUrl = "https://accounts.alipay.com/console/selectStrategy.htm?sp=1-addSecurityQuestion-fullpage&strategy=payment_password";// GlobalVar.zfb_reg_queryStrategy2; //填支付密码 Operation add_SQ = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.zfb_reg_nav2set_SecurityQuestion, NextStatus = BusinessStatus.zfb_reg_add_SecurityQuestion_Fill_PayPwd, CurrentUrl = "https://accounts.alipay.com/console/selectStrategy.htm?sp=1-addSecurityQuestion-fullpage&strategy=payment_password" , index = 23 }; add_SQ.OperationHandler += BT_zfb_reg_add_SecurityQuestion_Fill_PayPwd_Click; //填写安保 Operation setQa = new Operation(MainCefFrame) { PerviousStatus = BusinessStatus.zfb_reg_add_SecurityQuestion_Fill_PayPwd, NextStatus = BusinessStatus.zfb_reg_setQa, CurrentUrl = GlobalVar.zfb_reg_setQa , index = 24 }; setQa.OperationHandler += BT_zfb_reg_add_SecurityQuestion_Click; Operation setQa_confirm = new Operation(MainCefFrame) { index = 25, PerviousStatus = BusinessStatus.zfb_reg_setQa, NextStatus = BusinessStatus.zfb_reg_add_SecurityQuestion_setQa_confirm, CurrentUrl = GlobalVar.zfb_reg_add_SecurityQuestion_setQa_confirm }; setQa_confirm.OperationHandler += BT_zfb_reg_add_SecurityQuestion_setQa_confirm_Click; Operation add_sq_sucess = new Operation(MainCefFrame) { index = 26, PerviousStatus = BusinessStatus.zfb_reg_add_SecurityQuestion_setQa_confirm, NextStatus = BusinessStatus.zfb_reg_open_tb_before, CurrentUrl = "https://accounts.alipay.com/console/common/success.htm" }; add_sq_sucess.OperationHandler += Add_SQ_SUCESS; // //=========解绑手机 Operation nav2jiebang = new Operation(MainCefFrame) { index = 3.1, PerviousStatus = BusinessStatus.Zfb_reg_shifou_bangding_shouji_before, NextStatus = BusinessStatus.Zfb_reg_shifou_bangding_shouji, CurrentUrl = "https://my.alipay.com/portal/account/index.htm", note = "主页至解绑页" }; nav2jiebang.OperationHandler += (s, e) => { var res = CefFrameHelper.GetMsgByJs2(MainCefFrame, "document.getElementsByClassName('account-status-det')[2].getElementsByClassName('fn-left')[1].innerText", "gb2312"); LogManager.WriteLog(res); if (!string.IsNullOrEmpty(res) && res.Trim() == "未绑定") //未绑定 // state= tb_ TODO: { BT_ZFB_REG_nav2addsq_Click(s, e);//导航至添加密保 } else { MainCefFrame.LoadUrl("https://accounts.alipay.com/console/dispatch.htm?scene_code=removeMobile&site=1&page_type=fullpage"); } }; Operation removeMobile0 = new Operation(MainCefFrame) { index = 3.2, PerviousStatus = BusinessStatus.Zfb_reg_shifou_bangding_shouji, NextStatus = BusinessStatus.Zfb_reg_removeMobile0, CurrentUrl = "https://accounts.alipay.com/console/queryStrategy.htm?site=1&page_type=fullpage&sp=1-removeMobile-fullpage&scene_code=removeMobile", note = "选择解绑方式1-身份证" }; removeMobile0.OperationHandler += (s, e) => { MainCefFrame.LoadUrl("https://accounts.alipay.com/console/selectStrategy.htm?sp=1-removeMobile-fullpage&strategy=email-id_card_raw-payment_password"); }; //Operation removeMobile0 = new Operation(MainCefFrame) { // index = 3.2, // PerviousStatus = BusinessStatus.Zfb_reg_shifou_bangding_shouji, // NextStatus = BusinessStatus.Zfb_reg_removeMobile0, // CurrentUrl = "https://accounts.alipay.com/console/queryStrategy.htm?site=1&page_type=fullpage&sp=1-removeMobile-fullpage&scene_code=removeMobile", // note = "选择解绑方式2-手机" //}; //removeMobile0.OperationHandler += (s, e) => { // MainCefFrame.LoadUrl("https://accounts.alipay.com/console/selectStrategy.htm?sp=1-removeMobile-fullpage&strategy=sms-payment_password"); //}; Operation removeMobile1 = new Operation(MainCefFrame) { index = 3.2, PerviousStatus = BusinessStatus.Zfb_reg_removeMobile0, NextStatus = BusinessStatus.Zfb_reg_removeMobile1, CurrentUrl = "https://accounts.alipay.com/console/selectStrategy.htm?sp=1-removeMobile-fullpage&strategy=email-id_card_raw-payment_password", note = "输入身份证信息和支付密码" }; removeMobile1.OperationHandler += (s, e) => { Thread.Sleep(2000); CefFrameHelper.ExcuteJs(MainCefFrame, "document.getElementById('J-certNo').value='{0}';".With(currentHaoZi.zfbSFZ)); new Thread(() => { #region ---输入支付密码--- Thread.Sleep(1000); MouseKeyBordHelper.POINT p1; MouseKeyBordHelper.GetCursorPos(out p1); LogManager.WriteLog("mouse position {0},{1} ".With(p1.X, p1.Y)); LogManager.WriteLog("Form position {0},{1} ".With(this.Left, this.Top)); //int chax = 582 - 110; //int chay = 557 - 110; int chax = ConfigHelper.GetIntValue("取消手机页面左边距"); // 600 - 61; int chay = ConfigHelper.GetIntValue("取消手机页面上边距"); // 562 - 171; Thread.Sleep(1000); MouseKeyBordHelper.MoveAndLeftClick(this.Left, this.Top, chax, chay); Thread.Sleep(1000); var s1 = currentHaoZi.zfbPayPwd; LogManager.WriteLog(s1); MouseKeyBordHelper.KeyBoardDo(s1.ToCharArray()); #endregion //new Thread(() => { // Thread.Sleep(3000); //CefFrameHelper.ExcuteJs(MainCefFrame, // "document.getElementById('J-selectStrategyForm').submit();"); LogManager.WriteLog("mouse {0},{1} ".With(p1.X, p1.Y)); MouseKeyBordHelper.MoveAndLeftClick(this.Left, this.Top, chax, chay + ConfigHelper.GetIntValue("取消手机页面待移动距离")); // }).Start(); }).Start(); }; #region MyRegion //Operation removeMobile1 = new Operation(MainCefFrame) { // index = 3.2, // PerviousStatus = BusinessStatus.Zfb_reg_removeMobile0, // NextStatus = BusinessStatus.Zfb_reg_removeMobile1, // CurrentUrl = "https://accounts.alipay.com/console/selectStrategy.htm?sp=1-removeMobile-fullpage&strategy=email-id_card_raw-payment_password", // note = "输入手机验证码和支付密码" //}; //removeMobile1.OperationHandler += (s, e) => { // #region MyRegion // Thread.Sleep(2000); // string js1 = "document.getElementsByClassName('ui-button-text')[0].click();"; // CefFrameHelper.ExcuteJs(MainCefFrame, // js1); // new Thread(() => { // #region ---输入支付密码--- // Thread.Sleep(1000); // MouseKeyBordHelper.POINT p1; // MouseKeyBordHelper.GetCursorPos(out p1); // LogManager.WriteLog("mouse position {0},{1} ".With(p1.X, p1.Y)); // LogManager.WriteLog("Form position {0},{1} ".With(this.Left, this.Top)); // int chax = 367; // int chay = 403; // Thread.Sleep(1000); // MouseKeyBordHelper.MoveAndLeftClick(this.Left, this.Top, chax, chay); // Thread.Sleep(1000); // var s1 = currentHaoZi.zfbPayPwd; // LogManager.WriteLog(s1); // MouseKeyBordHelper.KeyBoardDo(s1.ToCharArray()); // #endregion // //收验证码 // LogManager.WriteLog("之前的号码是 {0} 继续获取".With(GlobalVar.phoneNum)); // string vcodeNum = ""; // bool isVcodeOk = SmsConfigHelper.GetSmsOfPhone(GlobalVar.phoneNum, ref vcodeNum, SmsServer.zfb_jiebang); // string js2 = "document.getElementById('J-inputCode').value='{0}';".With(vcodeNum); // CefFrameHelper.ExcuteJs(MainCefFrame, js2); // //new Thread(() => { // // Thread.Sleep(3000); // //CefFrameHelper.ExcuteJs(MainCefFrame, // // "document.getElementById('J-inputCode').click();"); // // "document.getElementById('J-selectStrategyForm').submit();"); // LogManager.WriteLog("mouse {0},{1} ".With(p1.X, p1.Y)); // MouseKeyBordHelper.MoveAndLeftClick(this.Left, this.Top, chax, chay + 65); // // }).Start(); // }).Start(); // #endregion //}; #endregion Operation removeMobile2 = new Operation(MainCefFrame) { index = 3.3, PerviousStatus = BusinessStatus.Zfb_reg_removeMobile1, NextStatus = BusinessStatus.Zfb_reg_removeMobile2, CurrentUrl = "https://accounts.alipay.com/console/common/email/sendSuccess.htm?emailType=securityCheckEmail&emailLogonId=", note = "去邮件完成验证" }; removeMobile2.OperationHandler += (s, e) => { //#3.3 var url = EmailCheck("请完成邮箱验证", "立即解除手机绑定"); if (!string.IsNullOrEmpty(url)) { MainCefFrame.LoadUrl(url); } }; Operation removeMobile3 = new Operation(MainCefFrame) { index = 3.4, PerviousStatus = BusinessStatus.Zfb_reg_removeMobile2, NextStatus = BusinessStatus.Zfb_reg_removeMobile3, CurrentUrl = "https://accounts.alipay.com/console/emailSecurityConfirm.htm?activeKey=", note = "点击链接,继续解绑手机" }; removeMobile3.OperationHandler += (s, e) => { var js = "window.location=window.frames[0].document.getElementsByClassName('linklist')[0].getElementsByTagName('a')[0].href;"; CefFrameHelper.ExcuteJs(MainCefFrame, js); }; Operation removeMobile4 = new Operation(MainCefFrame) { index = 3.5, PerviousStatus = BusinessStatus.Zfb_reg_removeMobile3, NextStatus = BusinessStatus.zfb_reg_nav2set_add_SecurityQuestion_before, CurrentUrl = "https://accounts.alipay.com/console/common/success.htm?sp=1-removeMobile-fullpage&isCancelCard=false&sp=1-removeMobile-fullpage&site=1&scene_code=removeMobile&page_type=fullpage", note = "解绑成功,继续添加密保" }; removeMobile4.OperationHandler += (s, e) => { // var CurrentUrl = "https://accounts.alipay.com/console/queryStrategy.htm?site=1&page_type=fullpage&sp=1-addSecurityQuestion-fullpage&scene_code=addSecurityQuestion"; BT_ZFB_REG_nav2addsq_Click(s, e); //state = BusinessStatus.zfb_reg_nav2set_add_SecurityQuestion_before; //MainCefFrame.LoadUrl( // "https://accounts.alipay.com/console/queryStrategy.htm?site=1&page_type=fullpage&sp=1-addSecurityQuestion-fullpage&scene_code=addSecurityQuestion" // ); //CurrentUrl = "https://my.alipay.com/portal/account/index.htm", }; // Operation taobaoopen = new Operation(MainCefFrame) { index = 27, PerviousStatus = BusinessStatus.zfb_reg_open_tb_before, NextStatus = BusinessStatus.zfb_reg_taobao_new_alipay_q, CurrentUrl = "https://my.alipay.com/portal/account/index.htm", note = "开通淘宝" }; // BusinessStatus.zfb_reg_taobao_new_alipay_q; taobaoopen.OperationHandler += BT_ZFB_REG_TB_open_Click; //zfb注册 手机验证 opsList.Add(nav2jiebang); opsList.Add(removeMobile0); opsList.Add(removeMobile1); opsList.Add(removeMobile2); opsList.Add(removeMobile3); opsList.Add(removeMobile4); //================= opsList.Add(zfb_reg_queryStrategy); opsList.Add(nav2set_SQ); opsList.Add(add_SQ); opsList.Add(setQa); opsList.Add(setQa_confirm); opsList.Add(add_sq_sucess); opsList.Add(taobaoopen); // //添加收货地址 }
//1 导航至添加密保 private void BT_ZFB_REG_nav2addsq_Click(object sender, EventArgs e) { state = BusinessStatus.zfb_reg_nav2set_add_SecurityQuestion_before; MainCefFrame.LoadUrl(GlobalVar.zfb_reg_nav2set_addSecurityQuestion); }
//2 选择支付宝密保 private void BT_zfb_reg_nav2set_SecurityQuestion_Click(object sender, EventArgs e) { MainCefFrame.LoadUrl(GlobalVar.zfb_reg_nav2set_SecurityQuestion); }
//开始 private void BT_TB_SHOPV2_Click(object sender, EventArgs e) { state = BusinessStatus.mtb; MainCefFrame.LoadUrl("http://login.m.taobao.com/login.htm"); }
public void TB_Reg_TB2_Click(object sender, EventArgs e) { state = BusinessStatus.new_register; MainCefFrame.LoadUrl("http://reg.taobao.com/member/new_register.jhtml"); // }
public void BT_Link_Continue_Reg_Click(object sender, EventArgs e) { state = BusinessStatus.zfb_reg_link_complete; MainCefFrame.LoadUrl(currentHaoZi.activeLink); }