Skip to content
Advertisement

How to get the a href link from under the div class? using beautiful soup

I am trying to scrape the href attribute from links from a page, but I end up with [] as the output

The HTML code is

My desired output is: https://www.pigiame.co.ke/listings/nissan-latio-2016-36000-kms-5300124

Advertisement

Answer

You can try:

JavaScript

Prints:

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