昊天SEO

Python Selenium 查找部分的链接文字链接

selenium

selenium

直接贴代码:

#coding:utf-8
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.baidu.com/s?ie=UTF-8&wd=%E6%96%B0%E4%B9%A1seo')
try:
 driver.find_element_by_partial_link_text('昊天').click()
 print("find the text link")
except Exception as e:
 print ('Exception,format(e)')

效果如下:

selenium

selenium

本文地址官网    新乡网站建设,seo

分享到:更多 ()
a