-1
  1. Hi developer. I am facing a problem in extracting a href value in python.
  2. I have a button there after clicking on "view Answer" it take me a next link I want to extract that data which is present in that link.

    <div class="col-md-11 col-xs-12">
    <a href="https://www.marham.pk/forum/thread/4471/i-need-a-good-orthopedic- dr">
    <div class="hover-div">
    <h2 itemprop="name">i need a good Orthopedic dr</h2>
    
    </div>
    </a>
    <div class="thread-details">
    <a href="https://www.marham.pk/forum/thread/4471/i-need-a-good-orthopedic-dr">
    <p class="pull-left"><span class="glyphicon glyphicon-comment"></span> View Answers (<span itemprop="answerCount">1</span>) </p>
            </a>
    </div>
    </div>
    
  3. I need to extract this href tag.

1 Answers1

0

You Can Use Data Scraping In Python. Beautiful Soup is a Python library for pulling data out of HTML and XML files.

import bs4 as bs

import urllib.request

sauce = urllib.request.urlopen("Your URL WILL GO HERE").read()

soup = bs.BeautifulSoup(sauce,'html5lib')

print(soup)

Community
  • 1
  • 1