擅长:python、mysql、java
<ol>
<li>使用google chrome浏览器打开页面</li>
<li>将鼠标移到要查找的元素上,然后右键单击它</li>
<li>左键单击“检查”(位于选择列表的底部)</li>
<li>您的元素将在开发人员工具中突出显示</li>
<li>在高亮图元上单击鼠标右键,然后选择“复制”</li>
<li>根据您的偏好,单击“复制选择器”或“XPath”</li>
<li>将其粘贴到selenium find_element_by_xpath()或find_element_by_css_selector()语句中。在</li>
</ol>
<p>说xpath</p>
<pre><code>element = browser.find_element_by_xpath("your pasted xpath")
assert element.text == 'Your expected text'
</code></pre>