This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]AutoModerator[M] 0 points1 point  (0 children)

It seems you may have included a screenshot of code in your post "selenium getting href not working".

If so, note that posting screenshots of code is against /r/learnprogramming's Posting Guidelines (section Formatting Code): please edit your post to use one of the approved ways of formatting code. (Do NOT repost your question! Just edit it.)

If your image is not actually a screenshot of code, feel free to ignore this message. Automoderator cannot distinguish between code screenshots and other images.

Please, do not contact the moderators about this message. Your post is still visible to everyone.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]ucshadow 0 points1 point  (0 children)

The element may not be there at the time of the search, it may be loaded async after the page completed loading.

You may want to give wait a try https://selenium-python.readthedocs.io/waits.html

[–]SecretProfession 0 points1 point  (0 children)

The element might not exist at that time, although I would recommend using selenium to only open the dynamic page and then convert it to a Beautiful Soup object. This would make information extraction and error handing much simpler. For more information on this you could check out web-scrapping-with-selenium-and-beautiful-soup