用python selenium提取网页中的所有<a>标签中的超级链接地址

urls = driver.find_elements_by_xpath("//a")
 
for url in urls:
    print(url.get_attribute("href"))

 //获取特定位置的a标签

FLODERURLSLIST = []
floderurls = browser.find_elements_by_xpath("/html/body/table[6]//a")

    for floderurl in floderurls:
        result = floderurl.get_attribute("href")
        FLODERURLSLIST.append(result)
        print(result)

 

posted @ 2020-04-24 09:22  胸怀丶若谷  阅读(12052)  评论(0编辑  收藏  举报