我的目標(biāo)是訪問(wèn)鏈接列表(位于"event?id=85042")。<tr class="gvrow"> == $0 <td>...</td> <td> <a href="event?id=85042" text </a> </td> ...這也會(huì)重復(fù),所以我想獲取位于 event?id=... 中的鏈接列表,我已經(jīng)從這個(gè)問(wèn)題Python Selenium - get href value嘗試過(guò)這種方法,但它返回一個(gè)充滿 None 的列表primary_links = driver.find_elements_by_class_name('gvrow')links = [elem.get_attribute('href') for elem in primary_links]print(links)輸出:[None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]期望的輸出:['https://www.iccf.com/event?id=85042', 'https://www.iccf.com/event?id=79897', 'https://www.iccf.com/event?id=66745', ...]那我該怎么辦呢?這是 html 的更好表示
訪問(wèn)標(biāo)簽內(nèi)的屬性
慕的地8271018
2023-07-11 13:43:57