知竹素遍春 發表於 2019-12-13 14:01:00

《手把手教你》系列进阶篇之3-python+ selenium自动化测试 - python几种骚操作你都知道吗?(详细教程)

<h3>1. 简介</h3>
<p>&nbsp;  这篇文章主要是给小伙伴或者童鞋们介绍和分享&nbsp;python几种骚操:读取配置文件、获取根目录的相对路径、获取系统时间和格式化时间显示、字符串切割等等操作。为后边的自动化框架打下一个结实的基础。</p>
<h3 class="title-article">2. Python读取配置文件内容</h3>
<p>  本文来介绍下Python中如何读取配置文件。任何一个项目,都涉及到了配置文件和管理和读写,Python支持很多配置文件的读写,这里我们就介绍一种配置文件格式的读取数据,叫ini文件。Python中有一个类ConfigParser支持读ini文件。</p>
<h4>2.1 新建一个文件夹</h4>
<p>  首先我们紧接着前边的内容,在项目下,新建一个文件夹,叫config,然后在这个文件夹下新建一个file类型的文件:config.ini</p>
<h5>2.1.1 代码实现:</h5>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213110711592-768281467.png" alt=""></p>
<h5>2.1.2 参考代码:</h5>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> this is config file, only store browser type and server URL</span>
<span style="color: rgba(0, 0, 0, 1)">

</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">browserName = Firefox</span>
browserName =<span style="color: rgba(0, 0, 0, 1)"> Chrome
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">browserName = IE</span>
<span style="color: rgba(0, 0, 0, 1)">

URL </span>= https://<span style="color: rgba(0, 0, 0, 1)">www.baidu.com
</span><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)">URL = http://www.google.com</span></pre>
</div>
<h4>2.2&nbsp;获取当前项目的根目录的相对路径</h4>
<p>  然后百度搜索一下,python中如何获取当前项目的根目录的相对路径这里采用:</p>
<div class="cnblogs_code">
<pre>os.path.dirname(os.path.abspath(<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">.</span><span style="color: rgba(128, 0, 0, 1)">'</span>))</pre>
</div>
<h4>2.3 新建测试类</h4>
<p>  最后,在另外一个包下新建一个测试类,用来测试读取配置文件是否正常。</p>
<h5>2.3.1 代码实现:</h5>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213111711644-1167806660.png" alt=""></p>
<h5>2.3.2 参考代码:</h5>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> coding=utf-8🔥</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 1.先设置编码,utf-8可支持中英文,如上,一般放在第一行</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 2.注释:包括记录创建时间,创建人,项目名称。</span>
<span style="color: rgba(128, 0, 0, 1)">'''</span><span style="color: rgba(128, 0, 0, 1)">
Created on 2019-12-13
@author: 北京-宏哥   QQ交流群:705269076
Project: 《手把手教你》系列进阶篇之3-python+ selenium自动化测试 - python基础扫盲
</span><span style="color: rgba(128, 0, 0, 1)">'''</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 3.导入模块</span>

<span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> configparser
</span><span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> os


</span><span style="color: rgba(0, 0, 255, 1)">class</span><span style="color: rgba(0, 0, 0, 1)"> TestReadConfigFile(object):

    </span><span style="color: rgba(0, 0, 255, 1)">def</span><span style="color: rgba(0, 0, 0, 1)"> get_value(self):
      root_dir </span>= os.path.dirname(os.path.abspath(<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">.</span><span style="color: rgba(128, 0, 0, 1)">'</span>)) <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 获取项目根目录的相对路径</span>
      <span style="color: rgba(0, 0, 255, 1)">print</span><span style="color: rgba(0, 0, 0, 1)"> (root_dir)

      config </span>=<span style="color: rgba(0, 0, 0, 1)"> configparser.ConfigParser()
      file_path </span>= os.path.dirname(os.path.abspath(<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">.</span><span style="color: rgba(128, 0, 0, 1)">'</span>)) + <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">/config/config.ini</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
      config.read(file_path)

      browser </span>= config.get(<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">browserType</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">browserName</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">)
      url </span>= config.get(<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">testServer</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">URL</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">)

      </span><span style="color: rgba(0, 0, 255, 1)">return</span>(browser,url) <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 返回的是一个元组</span>
<span style="color: rgba(0, 0, 0, 1)">
trcf </span>=<span style="color: rgba(0, 0, 0, 1)"> TestReadConfigFile()
</span><span style="color: rgba(0, 0, 255, 1)">print</span> (trcf.get_value())</pre>
</div>
<h5>2.3.3 运行结果:</h5>
<p>你可以试试更改config.ini的内容,看看测试打印出来是不是你更改的东西,在配置文件一般#表示注释,你想要哪行配置代码起作用,你就把前面的#去除,并且在注释其他同一个区域。在ini文件中 中括号包裹起来的部分叫section,了解一下就可以。</p>
<p>修改成如下图:</p>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213111835635-90292050.png" alt=""></p>
<p>&nbsp;运行代码后,控制台打印如下图的结果</p>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213111532181-1490993540.png" alt=""></p>
<h3 class="title-article">3. Python获取系统时间和格式化时间显示</h3>
<p>前面一篇文章介绍了,Python如何读取config.ini文件,还有如何获取当前项目根目录相对路径写法。在实际项目的开发,获取项目根路径的相对路径写法是很有必要的,不要去是绝对路径。因为,你自己开发的一个项目,如果拷贝到别的电脑里,发现运行不了,需要更改很多文件的路径,那是不是很失败。本篇文章介绍如何去获取和打印格式化系统时间,我们很多时候,看到一些日志,前面都会记录年月日,时分秒,甚至毫秒,然后才是日志描述。这一篇文章,介绍时间获取和格式化时间,就是为了后面,如何写一个简单的日志类做铺垫的。</p>
<p>在PyCharm下的一个包,右键,新建一个get_time.py文件,输入一下代码:</p>
<p>这里提醒一个小技巧:在输入导入包的时候,有些包你没有安装,不是系统自带的,可能会遇到红色下划线,你需要鼠标悬停在这个红色下划线,然后在这行的左侧有一个小灯泡,鼠标点击这个小灯泡,一般会有import this xxx 或者install xxx,根据提示来导入包或者安装第三方插件。</p>
<h4>3.1 代码实现:</h4>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213112704653-714498712.png" alt=""></p>
<h4>3.2 参考代码:</h4>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> coding=utf-8🔥</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 1.先设置编码,utf-8可支持中英文,如上,一般放在第一行</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 2.注释:包括记录创建时间,创建人,项目名称。</span>
<span style="color: rgba(128, 0, 0, 1)">'''</span><span style="color: rgba(128, 0, 0, 1)">
Created on 2019-12-13
@author: 北京-宏哥   QQ交流群:705269076
Project: 《手把手教你》系列进阶篇之3-python+ selenium自动化测试 - python基础扫盲
</span><span style="color: rgba(128, 0, 0, 1)">'''</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 3.导入模块</span>

<span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> time


</span><span style="color: rgba(0, 0, 255, 1)">class</span><span style="color: rgba(0, 0, 0, 1)"> GetTime(object):

    </span><span style="color: rgba(0, 0, 255, 1)">def</span><span style="color: rgba(0, 0, 0, 1)"> get_system_time(self):
      </span><span style="color: rgba(0, 0, 255, 1)">print</span> (time.time()) <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> time.time()获取的是从1970年到现在的间隔,单位是秒</span>
      <span style="color: rgba(0, 0, 255, 1)">print</span><span style="color: rgba(0, 0, 0, 1)"> (time.localtime())
      new_time </span>= time.strftime(<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">%Y-%m-%d %H:%M:%S</span><span style="color: rgba(128, 0, 0, 1)">'</span>, time.localtime()) <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 格式化时间,按照 2019-12-13 13:46:32的格式打印出来</span>
      <span style="color: rgba(0, 0, 255, 1)">print</span><span style="color: rgba(0, 0, 0, 1)"> (new_time)

gettime </span>=<span style="color: rgba(0, 0, 0, 1)"> GetTime()
gettime.get_system_time()</span></pre>
</div>
<h4>3.3 运行结果:</h4>
<p>运行代码后,控制台打印如下图的结果</p>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213112558754-990902586.png" alt=""></p>
<p><strong><span style="font-size: 14pt">!!!</span></strong>你自己试试如何打印出这样的效果: 20191213134750的效果。答案自己在文章最后查找。</p>
<h3 class="title-article">4. Python中字符串切割操作</h3>
<p>本文来介绍Python中字符串切割操作,在Python中自带的一个切割方法split(),这个方法不带参数,就默认按照空格去切割字段,如果带参数,就按照参数去切割。为了演示切割效果,我们用百度搜索一个关键字,然后去找一共找到了多个结果的数字。</p>
<p>&nbsp; &nbsp; &nbsp; 例如,百度搜索“selenium”,查看找到了多少个结果,我们需要单独摘取出这个数字。</p>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213141031377-1408099098.png" alt=""></p>
<p>相关脚本代码如下:</p>
<h4>4.1 代码实现:</h4>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213113701448-198877901.png" alt=""></p>
<h4>4.2 参考代码:</h4>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> coding=utf-8🔥</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 1.先设置编码,utf-8可支持中英文,如上,一般放在第一行</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 2.注释:包括记录创建时间,创建人,项目名称。</span>
<span style="color: rgba(128, 0, 0, 1)">'''</span><span style="color: rgba(128, 0, 0, 1)">
Created on 2019-12-13
@author: 北京-宏哥   QQ交流群:705269076
Project: 《手把手教你》系列进阶篇之3-python+ selenium自动化测试 - python基础扫盲
</span><span style="color: rgba(128, 0, 0, 1)">'''</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 3.导入模块</span>

<span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> time
</span><span style="color: rgba(0, 0, 255, 1)">from</span> selenium <span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> webdriver


</span><span style="color: rgba(0, 0, 255, 1)">class</span><span style="color: rgba(0, 0, 0, 1)"> GetSubString(object):

    </span><span style="color: rgba(0, 0, 255, 1)">def</span><span style="color: rgba(0, 0, 0, 1)"> get_search_result(self):
      driver </span>=<span style="color: rgba(0, 0, 0, 1)"> webdriver.Chrome()
      driver.maximize_window()
      driver.implicitly_wait(</span>8<span style="color: rgba(0, 0, 0, 1)">)

      driver.get(</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">https://www.baidu.com</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">)
      driver.find_element_by_id(</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">kw</span><span style="color: rgba(128, 0, 0, 1)">'</span>).send_keys(<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">selenium</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">)
      time.sleep(</span>1<span style="color: rgba(0, 0, 0, 1)">)
      driver.find_element_by_id(</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">su</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">).click()
      time.sleep(</span>1<span style="color: rgba(0, 0, 0, 1)">)
      search_result_string </span>= driver.find_element_by_xpath(<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">//*/div[@class='nums']</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">).text
      </span><span style="color: rgba(0, 0, 255, 1)">print</span><span style="color: rgba(0, 0, 0, 1)"> (search_result_string)

      new_string </span>= search_result_string.split(<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">约</span><span style="color: rgba(128, 0, 0, 1)">'</span>) <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 第一次切割得到 xxxx个,代表切割右边部分</span>
      <span style="color: rgba(0, 0, 255, 1)">print</span><span style="color: rgba(0, 0, 0, 1)"> (new_string)
      last_result </span>= new_string.split(<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">个</span><span style="color: rgba(128, 0, 0, 1)">'</span>) <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 第二次切割,得到我们想要的数字 代表切割参照参数的左边部分</span>
      <span style="color: rgba(0, 0, 255, 1)">print</span><span style="color: rgba(0, 0, 0, 1)"> (last_result)


getstring </span>=<span style="color: rgba(0, 0, 0, 1)"> GetSubString()
getstring.get_search_result()</span></pre>
</div>
<h4>4.3 运行结果:</h4>
<p>运行代码后,控制台打印如下图的结果</p>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213113615877-2089935574.png" alt=""></p>
<h3>5. 小结&nbsp;</h3>
<h4>5.1答案揭晓</h4>
<h5>5.1.1参考代码</h5>
<p>首先把上面的提问在这里把答案公布一下,其实很简单的,只需要修改一处地方即可以实现宏哥说的那种效果,聪明的你答对了没???</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> coding=utf-8🔥</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 1.先设置编码,utf-8可支持中英文,如上,一般放在第一行</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 2.注释:包括记录创建时间,创建人,项目名称。</span>
<span style="color: rgba(128, 0, 0, 1)">'''</span><span style="color: rgba(128, 0, 0, 1)">
Created on 2019-12-13
@author: 北京-宏哥   QQ交流群:705269076
Project: 《手把手教你》系列进阶篇之3-python+ selenium自动化测试 - python基础扫盲
</span><span style="color: rgba(128, 0, 0, 1)">'''</span>

<span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 3.导入模块</span>

<span style="color: rgba(0, 0, 255, 1)">import</span><span style="color: rgba(0, 0, 0, 1)"> time


</span><span style="color: rgba(0, 0, 255, 1)">class</span><span style="color: rgba(0, 0, 0, 1)"> GetTime(object):

    </span><span style="color: rgba(0, 0, 255, 1)">def</span><span style="color: rgba(0, 0, 0, 1)"> get_system_time(self):
      </span><span style="color: rgba(0, 0, 255, 1)">print</span> (time.time()) <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> time.time()获取的是从1970年到现在的间隔,单位是秒</span>
      <span style="color: rgba(0, 0, 255, 1)">print</span><span style="color: rgba(0, 0, 0, 1)"> (time.localtime())
      new_time </span>= time.strftime(<span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">%Y%m%d%H%M%S</span><span style="color: rgba(128, 0, 0, 1)">'</span>, time.localtime()) <span style="color: rgba(0, 128, 0, 1)">#</span><span style="color: rgba(0, 128, 0, 1)"> 格式化时间,按照 2017-04-15 13:46:32的格式打印出来</span>
      <span style="color: rgba(0, 0, 255, 1)">print</span><span style="color: rgba(0, 0, 0, 1)"> (new_time)

gettime </span>=<span style="color: rgba(0, 0, 0, 1)"> GetTime()
gettime.get_system_time()</span></pre>
</div>
<h5>&nbsp;5.1.2 代码运行效果</h5>
<p>将上述代码运行后看一下是不是宏哥说的那种效果</p>
<p><img src="https://img2018.cnblogs.com/i-beta/1232840/201912/1232840-20191213113036462-1920487334.png" alt=""></p>
<p>好了,今天的分享就到这里吧!!!谢谢各位的耐心阅读。</p>
<p>&nbsp;</p>
<p style="text-align: center"><span style="font-size: 18px"><strong><strong>您的肯定就是我进步的动力。</strong>如果你感觉还不错,就请鼓励一下吧!记得随手点波&nbsp;<span style="font-size: 18pt">推荐</span>&nbsp;不要忘记哦!!!</strong></span></p>
<p style="text-align: center"><span style="font-size: 18px; color: rgba(255, 0, 0, 1)"><strong>别忘了点推荐留下您来过痕迹</strong></span></p>
<p>&nbsp;</p>
<p><img style="display: block; margin-left: auto; margin-right: auto" src="https://img2018.cnblogs.com/blog/1232840/201908/1232840-20190816135641371-1314831001.gif" alt=""></p>

</div>
<div id="MySignature" role="contentinfo">
    <div id="MySignature" style="display: block">
        <div style="font-size: 13px; border: 1px dashed rgb(45, 161, 45); padding: 10px 15px; background-color: rgb(248, 248, 248)">
                <label style="font-weight: bold">
                        &nbsp;&nbsp;&nbsp;&nbsp;为了方便大家在移动端也能看到我分享的博文,现已注册个人微信公众号,扫描左下方二维码即可,欢迎大家关注,提前解锁更多测试干货!有时间会及时分享相关技术博文。
                </label>
                <br>
                <label style="font-weight: bold">
                        &nbsp;&nbsp;&nbsp;&nbsp;为了方便大家互动讨论相关技术问题,刚刚建立了咱们的专门的微信群交流互动群,群内会分享交流测试领域前沿知识。请您扫描中间的微信二维码进群
                </label>
                <br>
                <label style="font-weight: bold">
                        &nbsp;&nbsp;&nbsp;&nbsp;为了方便大家互动讨论相关技术问题,现已组建专门的微信群,由于微信群满100,请您扫描右下方宏哥个人微信二维码拉你进群
                        <label style="font-weight: bold; color: red; font-size: 15px">
                                (请务必备注:已关注公众号进群)平时上班忙(和你一样),所以加好友不及时,请稍安勿躁~
                        </label>
                        ,欢迎大家加入这个大家庭,我们一起畅游知识的海洋。
                </label>
                <br>
                &nbsp;&nbsp;&nbsp;&nbsp;感谢您花时间阅读此篇文章,如果您觉得这篇文章你学到了东西也是为了犒劳下博主的码字不易不妨打赏一下吧,让博主能喝上一杯咖啡,在此谢过了!
                <br>
                &nbsp;&nbsp;&nbsp;&nbsp;如果您觉得阅读本文对您有帮助,请点一下左下角
               
                        “推荐”
               
                按钮,您的
                <label style="font-weight: bold; color: red; font-size: 15px">
                        “推荐”
                </label>
                将是我最大的写作动力!另外您也可以选择
               
                        【
                        <strong>
                                关注我
                        </strong>
                        】
               
                ,可以很方便找到我!
                <br>
                &nbsp;&nbsp;&nbsp;&nbsp;本文版权归作者和博客园共有,来源网址:
               
                        https://www.cnblogs.com/du-hong
               
                欢迎各位转载,但是未经作者本人同意,转载文章之后必须在文章页面明显位置给出作者和原文连接,否则保留追究法律责任的权利!
        </div>
        <div style="text-align: center; margin-top: 10px">
                <p style=" font-weight: bolder; color: red; ">
                        公众号(关注宏哥)&NonBreakingSpace; &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;
                        &NonBreakingSpace; &NonBreakingSpace; &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;
                        &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace; &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;
                        &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace; &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;
                        微信群(扫码进群) &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;
                        &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace; &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;
                        &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace; &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;
                        &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace;
                        &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace; &NonBreakingSpace;&NonBreakingSpace;
                        &NonBreakingSpace;&NonBreakingSpace;&NonBreakingSpace; &NonBreakingSpace;&NonBreakingSpace;客服微信
                </p>
                <img style="width: 200px;padding-right: 50px;" alt="个人微信公众号" src="https://img2018.cnblogs.com/common/1741949/201911/1741949-20191119095948011-608816619.png">
                <img style="width: 200px;padding-right: 65px;" alt="微信群" src="https://img2024.cnblogs.com/blog/1232840/202506/1232840-20250610113707419-637869921.png">
                <img style="width: 200px" alt="个人微信" src="https://img2018.cnblogs.com/common/1741949/201911/1741949-20191106101257091-849954564.png">
        </div>
</div><br><br>
来源:https://www.cnblogs.com/du-hong/p/12030143.html
頁: [1]
查看完整版本: 《手把手教你》系列进阶篇之3-python+ selenium自动化测试 - python几种骚操作你都知道吗?(详细教程)