虽然这个问题最初是针对 IDE 提出的,但我只是通过 Google 来这里搜索Python的相同答案。
上面那个给出
AttributeError: 'WebElement' object has no attribute 'getAttribute'
Run Code Online (Sandbox Code Playgroud)
因为对于 Python 来说是
driver.find_element(By.xxx).get_attribute('href')
Run Code Online (Sandbox Code Playgroud)