from selenium import webdriver
import time
b=webdriver.Ie()
b.implicitly_wait(10)
b.get(‘www.baidu.com‘)
e2=b.find_element_by_id(‘u1‘)
list1=e2.find_elements_by_tag_name(‘a‘)
for i in list1:print(i.text,i.get_attribute("href"))
原文地址:https://www.cnblogs.com/dengpeiyou/p/9242612.html
时间: 2024-10-18 00:03:12