【笔记】随手记(2022.9.10)
# 指定Chromedriver路径 driver_path = r"F:\1\Python39\chromedriver90.exe" option = webdriver.ChromeOptions() # 指定Chrome浏览器路径 option.binary_location = r"C:\Program Files\Google\Chrome\Application\chrome.exe" # 添加插件到chrome浏览器中 option.add_argument("--user-data-dir="+r"C:/Users/Administrator/AppData/Local/Google/Chrome/User Data/") driver = WebChrome(driver_path,options=option) driver.maximize_window() driver.implicitly_wait(60) driver.get("chrome-extension://hehijbfgiekmjfkfjpbkbammjbdenadd/nhc.htm#url=http://10.1.80.100:8080/qcbin/start_a.jsp")
from selenium import webdriver #启用带插件的浏览器 option = webdriver.ChromeOptions() #用Chrome地址栏输入chrome://version/,查看自己的“个人资料路径”,然后在浏览器启动时,调用这个配置文件 option.add_argument("--user-data-dir="+r"C:/Users/Administrator/AppData/Local/Google/Chrome/User Data/") driver = webdriver.Chrome(chrome_options=option) # 打开chrome浏览器
# !/usr/bin/python
# -*- coding: UTF-8 -*-
C++ 那些事
https://github.com/Light-City/CPlusPlusThings
1 #include <iostream> 2 3 class Animal { 4 public: 5 Animal(int age,std::string name):age_(age),name_(name) { 6 std::cout << "Animal(int age) is called" << std::endl; 7 } 8 private: 9 int &age_; 10 const std::string name_; 11 }; 12 13 int main() { 14 Animal animal(10,"hh"); 15 return 0; 16 }
1. https://github.com/xmfbit/gtest-VisualStudio-CMake-example
msvc\gtest\Debug - Debug方案下的二进制文件:gtestd.lib、gtest_maind.lib
3. python+uiautomation【应用程序自动化】
https://blog.csdn.net/qq_21142893/article/details/84874406?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2-84874406-blog-121391639.pc_relevant_multi_platform_featuressortv2dupreplace&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2-84874406-blog-121391639.pc_relevant_multi_platform_featuressortv2dupreplace&utm_relevant_index=5
1 import os 2 import subprocess 3 import uiautomation as auto 4 5 subprocess.Popen("notepad.exe")# 从桌面的第一层子控件中找到记事本程序的窗口 6 # WindowControl 7 notepadWindow = auto.WindowControl(searchDepth=1, ClassName="Notepad") 8 print(notepadWindow.Name) 9 10 # 设置窗口前置 11 notepadWindow.SetTopmost(True) 12 13 ''' 14 file = "H:\Project_Visual_Studio\Project1\x64\Debug\Project1.exe" 15 subprocess.Popen(file) # 打开.exe 16 #window = auto.WindowControl(ClassName="#32770", searchDepth=1) # 窗口捕获 17 18 window1 = auto.WindowControl(Name="WeChat") # 进入软件 19 toolname = window1.ToolBarControl(ClassName="ToolbarWindow32") 20 21 #pane1 = window1.PaneControl(searchDepth=1, ClassName="设置") 22 # 打开脚本文件选择框 23 #toolname = window1.ToolBarControl(ClassName="ToolbarWindow32") 24 time.sleep(0.5) 25 openTfile = toolname.ButtonControl(Name="设置") 26 openTfile = toolname.ButtonControl 27 openTfile.Click() 28 '''
/*如果不加exterm "C",将无法再g++环境下编译*/ #ifdef _cplusplus extern "C" { #endif