新建项目!

This commit is contained in:
Kane Wang 2019-12-10 17:54:37 +08:00
parent 84ff952106
commit b681fc24d6
19 changed files with 584 additions and 0 deletions

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
#.idea/
.vs/
x64/
out/
ipch/
win32/
win64/
Debug/
Release/
GeneratedFiles/
*.~sql
*.~pck
*.~*
*.pkg
*.suo
*.sdf
*.opensdf
*.db
*.obj
workspace.xml
Browse.VC.opendb

View File

@ -0,0 +1,153 @@
#送返修数据采集
import time
from bs4 import BeautifulSoup
from urllib.error import HTTPError
from urllib.error import URLError
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.remote.webelement import WebElement
from selenium.common.exceptions import StaleElementReferenceException
from selenium.common.exceptions import NoSuchElementException
#常量
SITE_LINK = 'http://10.190.48.74:8601/'
IMAGE_LINK = 'images/repairMissionQuery.png'
BUTTON_TEXT = '统计查询'
MENU_TEXT = '送返修工单查询'
SCRAP_TIME_INTERVAL = 10 #抓取的时间间隔
def WaitForLogin( wbDriver, tagID ):
waitCount = 0
MaxCount = 100
while True:
#waitCount += 1
if waitCount > MaxCount:
print('骑上我的小摩托!!!!')
return
#查找id如果找到则继续循环如果找不到说明页面跳转了
try:
element = wbDriver.find_element_by_id( tagID )
print('等待用户登录!')
time.sleep(1)
except StaleElementReferenceException:
return
except NoSuchElementException:
return
#打开driver登录网页
try:
wb_ie = webdriver.Ie(executable_path='D:/develop/sdk/python/Selenium/ie_driver/IEDriverServer.exe')
wb_ie.get('http://10.190.48.74:8601/login.jsp')
except:
print('打开driver和网页时出错')
exit(-1)
action = ActionChains(wb_ie)
bs = BeautifulSoup( wb_ie.page_source, 'html.parser')
names = bs.find_all("img", {'id':'captcha'})
#填写登录信息
try:
captcha = wb_ie.find_element_by_id('captcha')
branchCode = wb_ie.find_element_by_id('branchCode')
userCode = wb_ie.find_element_by_id('userCode')
password = wb_ie.find_element_by_id('password')
branchCode.send_keys('3080100')
userCode.send_keys('588')
password.send_keys('Kane@1982')
except NoSuchElementException:
print('获取登录页面元素失败!')
wb_ie.close()
exit(-1)
try:
WaitForLogin( wb_ie, 'captcha')
except NoSuchElementException:
print('浏览器异常关闭!')
exit()
#输出cookie
try:
cookies = wb_ie.get_cookies()
cookie_dict = dict(cookies[0])
print( cookie_dict['name'] + '=' + cookie_dict['value'] )
except:
wb_ie.close()
exit()
try:
#点击统计查询
element = wb_ie.find_element_by_xpath("//*[text()='统计查询']")
action.move_to_element_with_offset(element, 1, 1 ).perform()
#time.sleep(1)
action.context_click(element).perform()
action.click(element)
action.perform()
#点击送返修工单查询
element = wb_ie.find_element_by_xpath("//*[text()='送返修工单查询']")
action.move_to_element_with_offset(element, 1, 1 ).perform()
#time.sleep(1)
action.context_click(element).perform()
action.click(element)
action.perform()
#time.sleep(1)
#切换iframe tabset_workOrderQuery
wb_ie.switch_to.frame('tabset_workOrderQuery')
#按钮
queryButton = wb_ie.find_element_by_xpath("//*[text()='查询']")
#日期元素
startDateElement = wb_ie.find_element_by_id('createStartDate')
endDateElement = wb_ie.find_element_by_id('createEndDate')
#开始查询和抓取循环
while True:
#填写起始日期和终止日期
startDateElement.clear()
endDateElement.clear()
startDateElement.send_keys('2019-11-10')
endDateElement.send_keys('2019-12-10')
#查询
action.move_to_element_with_offset( queryButton, 2, 2 ).perform()
action.click(queryButton).perform()
#查询后等待一段时间
#time.sleep(2)
except NoSuchElementException:
print('查找不到元素')
exit(-1)
except:
print('页面读取错误')
exit(-1)
finally:
#wb_ie.close()
None
while True:
time.sleep(1)
print('已登录!!!')

View File

@ -0,0 +1,47 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>81f2541e-c96a-4c05-b3f5-643b25e708d5</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>RepairOrderScrap\RepairOrderScrap.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>车商渠道数据采集</Name>
<RootNamespace>车商渠道数据采集</RootNamespace>
<InterpreterId>Global|PythonCore|3.8</InterpreterId>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Folder Include="RepairOrderScrap\" />
</ItemGroup>
<ItemGroup>
<Compile Include="RepairOrderScrap\RepairOrderScrap.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="RepairOrderScrap\__init__.py">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<InterpreterReference Include="Global|PythonCore|3.8" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>

View File

@ -0,0 +1,67 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29519.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "车商可视化数据管理系统", "车商可视化数据管理系统\车商可视化数据管理系统.vcxproj", "{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}"
EndProject
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "车商渠道数据采集", "..\python\车商渠道数据采集\车商渠道数据采集.pyproj", "{81F2541E-C96A-4C05-B3F5-643B25E708D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|Any CPU.ActiveCfg = Debug|x86
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|ARM.ActiveCfg = Debug|ARM
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|ARM.Build.0 = Debug|ARM
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|ARM.Deploy.0 = Debug|ARM
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|ARM64.ActiveCfg = Debug|ARM64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|ARM64.Build.0 = Debug|ARM64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|ARM64.Deploy.0 = Debug|ARM64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|x64.ActiveCfg = Debug|x64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|x64.Build.0 = Debug|x64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|x64.Deploy.0 = Debug|x64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|x86.ActiveCfg = Debug|x86
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|x86.Build.0 = Debug|x86
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Debug|x86.Deploy.0 = Debug|x86
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|Any CPU.ActiveCfg = Release|x86
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|ARM.ActiveCfg = Release|ARM
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|ARM.Build.0 = Release|ARM
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|ARM.Deploy.0 = Release|ARM
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|ARM64.ActiveCfg = Release|ARM64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|ARM64.Build.0 = Release|ARM64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|ARM64.Deploy.0 = Release|ARM64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|x64.ActiveCfg = Release|x64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|x64.Build.0 = Release|x64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|x64.Deploy.0 = Release|x64
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|x86.ActiveCfg = Release|x86
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|x86.Build.0 = Release|x86
{DFAB7824-DB3C-4114-AFE8-6DBD2892C07E}.Release|x86.Deploy.0 = Release|x86
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Debug|ARM.ActiveCfg = Debug|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Debug|x64.ActiveCfg = Debug|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Debug|x86.ActiveCfg = Debug|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Release|ARM.ActiveCfg = Release|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Release|ARM64.ActiveCfg = Release|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Release|x64.ActiveCfg = Release|Any CPU
{81F2541E-C96A-4C05-B3F5-643B25E708D5}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7E4BC0FE-85CA-48B9-B575-9487FEBCF24C}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,7 @@
#include <cstdio>
int main()
{
printf("hello from 车商可视化数据管理系统!\n");
return 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<link rel="stylesheet" type="text/css" href="stylesheet.css" media="screen">
<title>Getting Started</title>
</head>
<body>
<div class="container">
<div id="header">
<h1>Getting Started</h1>
<h2>Visual C++ for Linux Development</h2>
</div>
<table>
<tr>
<div id="main_content">
<td>
<div id="lpanel">
<h1>Setting up your project for Linux Development</h1>
<p>With this workload you can author C++ code for Linux servers, desktops and devices. You can manage your connections to these machines from within VS. VS will automatically copy and remotely build your sources and can launch your application with the debugger. Our project system supports targeting specific architectures, including ARM.</p>
<img src="images\ArchOptions.gif"/>
<h1>Connecting to Linux</h1>
<h2>Prerequisites</h2>
<p>Today we only support building remotely on the Linux target machine. We are not limited by specific Linux distros but we do have dependencies on the presence of some tools. Specifically, we need openssh-server, g++, gdb and gdbserver. Use your favorite package manager to install them, e.g. on Debian based systems: sudo apt-get install openssh-server g++ gdb gdbserver</p>
<h2>First connection</h2>
<p>The first time you target a Linux machine you will be prompted for connection information. This is triggered by building the project.</p>
<img src="images\firstconnection.png"/>
<h2>Adding and removing connections</h2>
<p>To add a new connection, go to Tools > Options and search for Connection, Connection Manager will be under Cross Platform. From here you can add and remove connections.</p>
<img src="images\ManageConnections.gif"/>
<p>To change which connection a project is using go to the project properties general settings and update the Remote Build Machine option.</p>
<img src="images\ChangeRemote.gif"/>
<h1>Project Properties</h1>
<p>All of the options necessary to control C++ compilation are exposed on the project properies pages. We'll cover a few specific to how things work for Linux. First under general settings, you will see the remote root is set to ~/projects/ by default and that we are setting the remote project directory to match our project name in that location. </p>
<img src="images\OutputTypes.gif"/>
<p>Looking at the General settings for the project, you can see how our output and intermediate directories were configured. Additionally, youll see that this project was configured as an application thus our executable is under bin/x64/Debug/ as ConsoleApplication1.out. Notice that for configuration types we also support static and dynamic libraries.</p>
<p>Add additional library dependencies on the Linker > Input property page.</p>
<img src="images\linker.png"/>
<p>You can pass additional pre launch commands to the debugger to do things like launch graphical apps on the remote linux machine.</p>
<img src="images\debuggerexport.png"/>
<p>You can also send post build events to control remote behavior, as in this example that exports a gpio pin for use without requiring the executable run as super user.</p>
<img src="images\postbuild.png"/>
</div>
</td>
<td>
<div id="rpanel">
<h1>Resources</h1>
<p>Check out the <a href="http://aka.ms/vslinux">VC++ for Linux Development page</a> where we will keep updates posted and provider more in depth details on usage.</p>
<h1>Give us feedback</h1>
<p>Use the send feedback function in Visual Studio or contact us directly at <a href="mailto:vcpplinux-support@microsoft.com?subject=Linux%20Console%20App%20question">VC++ Linux Support</a></p>
</div>
</td>
</div>
</tr>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,119 @@
body {
margin: 0;
padding: 0;
border: 0;
color: #1E1E1E;
font-size: 13px;
font-family: "Segoe UI", Helvetica, Arial, sans-serif;
line-height: 1.45;
word-wrap: break-word;
}
/* General & 'Reset' Stuff */
.container {
width: 1100px;
margin: 0 auto;
}
section {
display: block;
margin: 0;
}
h1, h2, h3, h4, h5, h6 {
margin: 0;
}
table, tr {
width: 1100px;
padding: 0px;
vertical-align: top;
}
/* Header, <header>
header - container
h1 - project name
h2 - project description
*/
#header {
color: #FFF;
background: #68217a;
position:relative;
}
h1, h2 {
font-family: "Segoe UI Light", "Segoe UI", Helvetica, Arial, sans-serif;
line-height: 1;
margin: 0 18px;;
padding: 0;
}
#header h1 {
font-size: 3.4em;
padding-top: 18px;
font-weight: normal;
margin-left: 15px;
}
#header h2 {
font-size: 1.5em;
margin-top: 10px;
padding-bottom: 18px;
font-weight: normal;
}
#main_content {
width: 100%;
display: flex;
flex-direction: row;
}
h1, h2, h3, h4, h5, h6 {
font-weight: bolder;
}
#main_content h1 {
font-size: 1.8em;
margin-top: 34px;
}
#main_content h1:first-child {
margin-top: 30px;
}
#main_content h2 {
font-size: 1.8em;
}
p, ul {
margin: 11px 18px;
}
#main_content a {
color: #06C;
text-decoration: none;
}
ul {
margin-top: 13px;
margin-left: 18px;
padding-left: 0;
}
ul li {
margin-left: 18px;
padding-left: 0;
}
#lpanel {
width: 870px;
float: left;
}
#rpanel ul {
list-style-type: none;
}
#rpanel ul li {
line-height: 1.8em;
}
#rpanel {
background: #e7e7e7;
width: 230px;
}

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{dfab7824-db3c-4114-afe8-6dbd2892c07e}</ProjectGuid>
<Keyword>Linux</Keyword>
<RootNamespace>车商可视化数据管理系统</RootNamespace>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<ApplicationType>Linux</ApplicationType>
<ApplicationTypeRevision>1.0</ApplicationTypeRevision>
<TargetLinuxPlatform>Generic</TargetLinuxPlatform>
<LinuxProjectType>{D51BCBC9-82E9-4017-911E-C93873C4EA2B}</LinuxProjectType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemDefinitionGroup />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>LinuxDebugger</DebuggerFlavor>
<RemoteDebugTarget>0</RemoteDebugTarget>
</PropertyGroup>
</Project>

Binary file not shown.