我的目標是訪問鏈接列表(位于"event?id=85042")。<tr class="gvrow"> == $0 <td>...</td> <td> <a href="event?id=85042" text </a> </td> ...這也會重復,所以我想獲取位于 event?id=... 中的鏈接列表,我已經從這個問題Python Selenium - get href value嘗試過這種方法,但它返回一個充滿 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 的更好表示
訪問標簽內的屬性
慕的地8271018
2023-07-11 13:43:57