- Hi developer. I am facing a problem in extracting a href value in python.
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>
I need to extract this href tag.
Asked
Active
Viewed 232 times
-1

Jagga Lyalpuria
- 1
- 3
1 Answers
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

Munaf Hajir
- 67
- 8
-
If You Didn't Understand The Answer Comment It below.And clarify your question. Whether you want that link extract from html tag or you want to extract the data from that link. – Munaf Hajir Nov 07 '17 at 13:22
-
i want to extract data from that href – Jagga Lyalpuria Nov 07 '17 at 13:30
-
Then You Have To Use BeatifulSoup Library Of Python. It will Extract the data from given Link. If any help needed comment below. – Munaf Hajir Nov 07 '17 at 13:35
-
yes i know this but how?? i want to extract the value which is on that href means after clicking this link that value which is shown on that address – Jagga Lyalpuria Nov 07 '17 at 13:37
-
Yeah I Done Some Changes In My Post. I Added Some Code Give A Try – Munaf Hajir Nov 07 '17 at 13:49
-
sorry you don't understand what i am saying can i ping you on skype?? – Jagga Lyalpuria Nov 07 '17 at 14:50
-
Ping me on LinkedIn Search For Munaf Hajir – Munaf Hajir Nov 07 '17 at 14:53