w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Extracting links with href attribute in Python BeautifulSoup

I tested you HTML code using BeautifulSoup 4:

from bs4 import BeautifulSoup

soup = BeautifulSoup(html)

for a in soup.find_all('a'):
    if 'href' in a.attrs:
        print a['href']


http://54.75.225.110/quiz/answer/56595




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.