Skip to content
Advertisement

Unable to find element BeautifulSoup

I am trying to parse a specific href link from the following website: https://www.murray-intl.co.uk/en/literature-library.

Element i seek to parse:

JavaScript

However, using BeautifulSoup I am unable to obtain the desired element, perhaps due to cookies acceptance.

JavaScript

I am still new at BS4, and hope someone can help me on the right course.

Thank you in advance!

Advertisement

Answer

To get correct tags, remove "focus-within" class (it’s added later by JavaScript):

JavaScript

Prints:

JavaScript

EDIT: To get only the specified link you can use for example CSS selector:

JavaScript

Prints:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement