我想知道如何抓取這個網站:https://1997-2001.state.gov/briefings/statements/2000/2000_index.html它只包含'a'和'href',沒有類或ID,結構非常簡單。我想運行一個字符串來抓取頁面上所有鏈接的內容。我已經使用 chromedriver 嘗試過這段代碼,但它只打印了鏈接列表(我在網絡抓取方面非常業余)。任何幫助都會很棒。 >>> elems = driver.find_elements_by_xpath("//a[@href]")
>>> for elem in elems:
... print(elem.get_attribute("href"))
在Python上使用selenium或beautifulsoup從帶有鏈接的頁面中抓取數據
慕田峪7331174
2023-08-08 10:00:19