how to select tags from with in another tag in beautifulsoap code example

Example 1: how to select tags from with in another tag in beautifulsoap

a_tag = html.a
link = a_tag['href']
print(link)

https://example.com

Example 2: how to select tags from with in another tag in beautifulsoap

from bs4 import BeautifulSoup

soup = BeautifulSoup(SomePage, 'lxml')
html = soup.find('div', class_='base class')
print(html)

<div class="base class">
  <div>Sample text 1</div>
  <div>Sample text 2</div>
  <div>
    <a class="ordinary link" href="https://example.com">URL text</a>
  </div>
</div>

<div class="Confusing class"></div>
'''

Tags:

Php Example