Commit 893902aa authored by 黄奎's avatar 黄奎

页面修改

parent 23f418ea
......@@ -69,7 +69,7 @@ namespace TicketSpider.Spiders.ClassInRule
public static bool RunAsync()
{
var flag = false;
var option = new FirefoxOptions();
option.AddArgument("--incognito");
string IsOpenChrome = VTX.FW.Helper.ConfigHelper.GetAppsettings("IsOpenChrome");
......@@ -123,8 +123,10 @@ namespace TicketSpider.Spiders.ClassInRule
});
if (inputEle != null && pwdEle != null)
{
inputEle.SendKeys("18140082327");
pwdEle.SendKeys("ls123456");
inputEle.SendKeys("18140082527");
//a123456 校管家新密码
//ls123456 校管家老密码
pwdEle.SendKeys("a123456");
}
}
catch (Exception ex)
......@@ -272,29 +274,48 @@ namespace TicketSpider.Spiders.ClassInRule
var fileBgPath = $"{dirpath}\\{DateTime.Now.Ticks}.png";
bgPng.SaveAsFile(fileBgPath, ScreenshotImageFormat.Png);
((IJavaScriptExecutor)driver).ExecuteScript("document.getElementsByClassName(\"tc-fg-item\")[0].style.display = 'block';document.getElementsByClassName(\"tc-fg-item\")[1].style.display = 'block';document.getElementsByClassName(\"tc-fg-item\")[2].style.display = 'block';");
((IJavaScriptExecutor)driver).ExecuteScript("document.getElementById(\"slideBg\").style.display = 'none';");
var blockElements= driver.FindElements(By.ClassName("tc-fg-item"));
var fileBlockPath = $"{dirpath}\\{DateTime.Now.Ticks }__1.png";
var blockElements = driver.FindElements(By.ClassName("tc-fg-item"));
var fileBlockPath1 = $"{dirpath}\\{DateTime.Now.Ticks }__1.png";
var fileBlockPath2 = $"{dirpath}\\{DateTime.Now.Ticks }__2.png";
var fileBlockPath3 = $"{dirpath}\\{DateTime.Now.Ticks }__3.png";
if (blockElements != null && blockElements.Count == 3)
{
int index = 0;
foreach (var item in blockElements)
{
if (index == blockElements.Count - 2)
if (index == 0)
{
((IJavaScriptExecutor)driver).ExecuteScript("document.getElementsByClassName(\"tc-fg-item\")[0].style.display = 'block';");
//var blockPng = ((ITakesScreenshot)item).GetScreenshot();
//blockPng.SaveAsFile(fileBlockPath1, ScreenshotImageFormat.Png);
}
if (index == 1)
{
var fileBlockPath2 = $"{dirpath}\\{DateTime.Now.Ticks }__{index}.png";
((IJavaScriptExecutor)driver).ExecuteScript("document.getElementsByClassName(\"tc-fg-item\")[1].style.display = 'block';");
var blockPng = ((ITakesScreenshot)item).GetScreenshot();
blockPng.SaveAsFile(fileBlockPath, ScreenshotImageFormat.Png);
blockPng.SaveAsFile(fileBlockPath2, ScreenshotImageFormat.Png);
}
if (index == 2)
{
((IJavaScriptExecutor)driver).ExecuteScript("document.getElementsByClassName(\"tc-fg-item\")[2].style.display = 'block';");
var blockPng = ((ITakesScreenshot)item).GetScreenshot();
blockPng.SaveAsFile(fileBlockPath3, ScreenshotImageFormat.Png);
}
index++;
}
}
((IJavaScriptExecutor)driver).ExecuteScript("document.getElementById(\"slideBg\").style.display = 'block';");
var bgX = FireFoxGetBoundary(fileBgPath, fileBlockPath);
var bgX = FireFoxGetBoundary(fileBgPath, fileBlockPath2);
if (bgX < 0)
{
bgX = FireFoxGetBoundary(fileBgPath, fileBlockPath3);
}
InfoHelper.WriteLine($"读取背景缺口边界X坐标: {bgX}");
VTX.FW.Helper.LogHelper.WriteInfo("BeginSliderLoginHandler", $"读取背景缺口边界X坐标: {bgX}");
......@@ -302,7 +323,6 @@ namespace TicketSpider.Spiders.ClassInRule
var sliderButton = driver.FindElement(By.ClassName("tc-slider-normal"));
if (sliderButton != null)
{
//((IJavaScriptExecutor)driver).ExecuteScript("document.getElementById(\"slideBlock\").style.opacity = 1;");
action.ClickAndHold(sliderButton).Build().Perform();
#region 开始拟人移动
var d1 = Math.Round(bgX * 0.8);
......
......@@ -19,7 +19,7 @@ namespace TicketSpider.Spiders.ClassInRule
{
ClassInAccountManager.ClearCookie();
string key = EduSpider.Cache.CacheKey.ClassIn_Cookie_Key;
int ExpirTime = 60 * 60 * 12;
int ExpirTime = 60 * 60 * 12;
var cacheCookie = EduSpider.Cache.User.UserReidsCache.GetClassInCookie(key);
if (cacheCookie != null && !string.IsNullOrEmpty(cacheCookie.CacheCookies.ToString()))
{
......@@ -30,7 +30,7 @@ namespace TicketSpider.Spiders.ClassInRule
loginCookies = ClassInAccountManager.GetInstance();
if (!string.IsNullOrEmpty(loginCookies))
{
EduSpider.Cache.User.UserReidsCache.ClassInCookieSet(key, new EduSpider.Cache.User.ClassInTokenItem() { CacheCookies=loginCookies}, ExpirTime);
EduSpider.Cache.User.UserReidsCache.ClassInCookieSet(key, new EduSpider.Cache.User.ClassInTokenItem() { CacheCookies = loginCookies }, ExpirTime);
}
}
}
......
{
//连接字符串
"ConnectionStrings": {
"DefaultConnection": "server=rm-bp1tj77h6kp0d02fbwo.mysql.rds.aliyuncs.com;user id=reborn;password=Reborn@2018;database=uat_reborn_think;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DefaultConnection": "server=192.168.10.214;user id=reborn;password=Reborn@2018;database=reborn_think;CharSet=utf8mb4; Convert Zero Datetime=true; ",
"DefaultConnectionPName": "MySql.Data.MySqlClient"
},
//是否开启Chrome[1-开启,0-关闭]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment