当前位置:网站首页>Web knowledge supplement

Web knowledge supplement

2022-07-04 13:42:00 Hua Weiyun

Get New knowledge :

windows The host machine Map folder to VMware Linux virtual machine

First, when the virtual machine is shut down , Edit virtual machine settings , Under option configuration , Enable shared folders , Select the host folder path , determine .

 Insert picture description here

Enter virtual machine , Use
// yum -y install open-vm-tools-desktop open-vm-tools
mkdir /app ;vmhgfs-fuse .host:/ /app
command Mount the contents under the shared folder to the virtual machine path , among /app Is the customized folder path under the virtual machine , After successful execution, the contents in the shared folder exist under the corresponding folder of the virtual machine .

Use selenium Avoid being identified by the website as an automated test tool driven approach

  1. Set up window.navigator.webdriver

Through the following code to achieve

driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {    "source": """ Object.defineProperty(navigator, 'webdriver', { get: () => undefined }) """})
  1. modify chromedriver.exe

stay Windows Next , Use notepad++ There may be garbled code when opening , Unable to perform the following operation to replace the string , It is suggested that Linux Operation down , Although in Linux There will also be garbled code in the next operation , But the string we need to replace is in Linux It's normal to open it under , Use vim edit chromedriver.exe, Use vim Replace the command
:%s/cdc_/dog_/g
then :wq Save to exit , Complete the modification .

Windows Use the longest path under

By default Windows Be able to use 260 Path length of bit length , But in fact Windows Maximum support for paths up to tens of thousands of bits , It needs to be preceded by \?\ Is to tell the system to use the path definition with the maximum length .

Special for sharing price folder , Use \?\UNC\ that will do .

原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041155517150.html