Scrape all hyperlinks in a page

11 views
Skip to first unread message

Douglas Scheesley

unread,
Jun 8, 2023, 1:05:10 AM6/8/23
to Selenium Users
Hi,
I am trying to scrape all hyperlinks by using the following, but it does not seem to work. In a bunch of examples I have seen tagName was an example used, but my compiler Visual Studio 2022 is telling me it is deprecated. Any help would be most appreciated. In javascript.

    let element = driver.findElement(By.css('a'));
    let elements = await element.findElements(By.css('a'));
    for (let e of elements) {
        console.log(await e.getText());
    }
Reply all
Reply to author
Forward
0 new messages