May-28-2022, 02:30 PM
(May-28-2022, 02:15 PM)snippsat Wrote: This is the old wayOk, it works.browser.find_elements_by_xpath
(Deprecated) when use Selenium 4 is like this.
Output:Advanced Artificial Intelligence and Robo-Justice Springer (May 16, 2022) Springer (May 16, 2022)
But this method relies on the layout of this book.
With another book, the layout may be slightly different.
I think a safer method is to find the tag containing "Publisher", then move to the next tag at the same level of hierarchy, and finally extract the text from that tag.
Can selenium provide such methods.
If I remember correctly, BeautifulSoup provides a navigation functions over neighboring tags.