from selenium import webdriver

driver = webdriver.Chrome("./chromedriver.exe")

driver.get("http://baidu.com")
assert "百度" in driver.title

elem=driver.find_elements_by_tag_name("a")

for link in elem:
    print(link.get_attribute("href"))
    print(link.get_attribute("text"))

driver.quit()

f88544d29240cb9da9873b2617974ac0c8a0656e
<mask token>

<mask token>
driver.get('http://baidu.com')
assert '百度' in driver.title
<mask token>
for link in elem:
    print(link.get_attribute('href'))
    print(link.get_attribute('text'))
driver.quit()

<mask token>
driver = webdriver.Chrome('./chromedriver.exe')
driver.get('http://baidu.com')
assert '百度' in driver.title
elem = driver.find_elements_by_tag_name('a')
for link in elem:
    print(link.get_attribute('href'))
    print(link.get_attribute('text'))
driver.quit()

from selenium import webdriver
driver = webdriver.Chrome('./chromedriver.exe')
driver.get('http://baidu.com')
assert '百度' in driver.title
elem = driver.find_elements_by_tag_name('a')
for link in elem:
    print(link.get_attribute('href'))
    print(link.get_attribute('text'))
driver.quit()

from selenium import webdriver

driver = webdriver.Chrome("./chromedriver.exe")

driver.get("http://baidu.com")
assert "百度" in driver.title

elem=driver.find_elements_by_tag_name("a")

for link in elem:
    print(link.get_attribute("href"))
    print(link.get_attribute("text"))

driver.quit()
